Skip to content

Instantly share code, notes, and snippets.

@farmanp
Created January 16, 2017 06:56
Show Gist options
  • Save farmanp/6f63142893aaccab8924bd71af166a88 to your computer and use it in GitHub Desktop.
Save farmanp/6f63142893aaccab8924bd71af166a88 to your computer and use it in GitHub Desktop.
Finding out how to use Bootstrap in React-Rails
render: function () {
return (
<div bsClass="container-fluid">
<div bsClass="row-fluid">
<div className="email-box">
<EmailList emails={ this.state.emails } />
<hr />
<h2>Add a Email:</h2>
<EmailForm form={ this.state.form } onEmailSubmit={ this.handleEmailSubmit } />
</div>
</div>
</div>
);
}
});
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*= require_tree .
*= require_self
*= bootstrap-sprockets
*= bootstrap
*/
.email-box h2 {
color: red;
}
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require react
//= require react_ujs
//= require react_bootstrap
//= require bootstrap-sprockets
//= require components
//= require_tree ./components
<div class="container">
<div class="row">
<%= react_component('EmailBox', {:presenter => @presenter.to_json}) %>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment