I have installed bourbon, neat and refills and would like to use modal window. Following the instructions I made:
rails generate refills:import modal
I have the modal partial and added to the page
<%= render 'refills/modal' %>
The result:
Any idea what I missed? Thank you!
You need to add the following code to application.js
// require refills/modal
And then you need to add the following line to application.scss:
#import 'refills/modal';
That should do it.
Related
I use Rails 4 and bootstrap-select-rails gem.
When I download page with my form, I got this
When I refresh page, I got this
If I turn off turbolinks, design is ok, but site is very slow.
How to display the correct design at first download without disabling turbolinks?
UPD:
at application.js:
//= require bootstrap-select
at application.scss:
#import "bootstrap-select";
at view:
=select_tag "document_id",
options_from_collection_for_select(#documents,'id', 'name'),
class: "selectpicker",
"data-live-search".to_sym => "true"
I added data-no-turbolink attribute to link
New
Im not sure on how to change my ruby on rails application to fluid. At the moment it is fixed using sass twitter bootstrap and im struggling on finding the right way to change the entire application to fluid.
Could someone please point me in the right direction thanks.
In order to use fluid layouts in Bootstrap you must do two things:
Replace .row classes with .row-fluid in your view templates.
Load the responsive layout css file.
If you are using SASS, and assuming you have an application.css.scss file, make sure it's set up the following way:
#import "bootstrap";
#import "bootstrap-responsive";
Finally, when using a fluid grid make sure inner columns always add up to a total of 12:
<div class="row-fluid">
<div class="span6"></div>
<div class="span6"></div>
</div>
You can use any number of columns as long as they always add up to 12.
Looking to use an icon for a delete button in a table, as shown below:
<i class="icon-white icon-trash"></i>
If I paste this code into a plain html page within my rails application, the btn-mini and btn-small seem to have no effect.
When I preview this button on http://www.plugolabs.com/twitter-bootstrap-button-generator/ it appears as I would expect. Anyone familiar with why this may not be working? I do not have any custom css files loading, just the bootstrap.
Also, I am running
gem 'bootstrap-sass', '~> 2.0.4.0'
Thanks!
Take a look at bootstrap-sass source in here:
https://github.com/twbs/bootstrap-sass/blob/master/vendor/assets/stylesheets/bootstrap/_buttons.scss
The gem uses Bootstrap 3, so use:
.btn-xs instead of .btn-mini
.btn-sm instead of .btn-small
.btn-lg instead if .btn-large
I got similar problem and my solution was to change of gem. Have you tried to change your bootstrap gem? Check it out this one
I did bundle and generate install and now I have the jquery's files instead of prototype
I can see from mozilla firebug that the jquery's files are included, however I can't use jQuery or $ functions, the app/mozilla console don't know them.
Any suggestions how to fix this?
I'm using jquery-rails 1.0.12 and rails 3.0.8
It would be great if you could give more details but here are some things you can try:
Make sure that when you view the page source you can see the jQuery files are included. I usually have <%= javascript_include_tag :defaults %> between the HEAD tags
You can test if everything is working by adding the following code:
$(document).ready(function() {
alert('hello world');
});
Hope this helps
Make sure the line below is commented out (in application.rb) and that you have restarted your server.
config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
I am trying to make a URL like Link Title from within my application. What is the file that I need to edit to link this URL to a controller and then a view?
Also, I am still working my way through this tutorial:
http://guides.rubyonrails.org/layouts_and_rendering.html
and I am wondering when they do something like this:
<%= stylesheet_link_tag "http://example.com/main.css" %>
is that supposed to live in the application.html.erb file or the index.html.erb file?
What is the file that I need to edit to link this url to a controller and then a view?
routes.rb
See the rails guide
is that supposed to live in the application.html.erb file or the index.html.erb file?
The simple answer is: application.html.erb, inside the head section. There are ways of injecting view template stuff into the head, but if you're just starting out, stick with application.html.erb.