I have added jquery-ui with rails 3.1 but I am not sure where the respected css has to be added. What are necessary steps to be added for this?
We always put them in a folder underpublic/stylesheets
Edit: this is rails2-specific advice...
I am not sure if this is the best place to put it, but mine works here.
app/assets/stylesheets
Related
How can I use a theme from Bulmaswatch in my rails app? I'm currently using the bulma-rails gem. Bulmaswatch recommend using their CDN but how to get it work with the asset pipeline? What's the simplest easier way to get it done?
(Supposition is you have routes, controllers, views sorted)
Add the bulma gem (cdn not needed)
Add any number of Boostrap gems that play well with sass
Bundle
Add #import "bulma"; into application file
Restart the server
IMHO the easiest way is:
Under app/assets/stylesheets delete application.css and create a new file called application.css.scss
Then in that file copy paste the code from your favorite theme on bulmaswatch.
There you go, you've got a unique theme working in bulma.
This question is somewhat similar to: How to customize bulma variables in rails
I would like to use social buttons as in this site: http://lipis.github.io/bootstrap-social/
It's going to be used in a Ruby on Rails project. I've already got Bootstrap working in the project, but I can't figure out how to add bootstrap-social.
Sorry for the noobish question, but I can't seem to get this right :(
You can use a gem: https://github.com/gavinkflam/bootstrap-social-rails
You can download separate files: bootstrap-social/bootstrap-social.css (or scss) and bootstrap-social/assets/js/docs.js from a repo in your link http://lipis.github.io/bootstrap-social/ and put them into your vendor/assets/stylesheets and vendor/assets/javascripts respectively.
I would download the Bootstrap-social project and copy the bootstrap-social to the project you are currently working on. After that you could say #import "$file"; in the application.css file.
I'm switching from PHP to Ruby on Rails and I'm loving it, the only thing is I'm so used to Twitter Bootstrap for most of my designs and now I feel crippled without it, I followed some tutorials like adding bootstrap-sass and what not to my Gemfile, but I still appear to be missing important things like input-block-level I'm just curious if there is an updated version or a easier tutorial to follow? Thanks.
AFAIK, the easiest and most rails way to integrate the twitter bootstrap to rails is via
twitter-bootstrap-rails gem, they have a pretty good documentation too.
check these screen casts, and this (premium) to get an idea.
and welcome to Rails :)
To to the input-block-level in ERB do something like this
"input-block-level" => "hello_world"
Same as you, I'm coming from PHP and love RoR ;)
With bootstrap you need to import it in your manifest. Read a bit about the assets pipeline in RoR guide.
To import bootstrap, create a file in your app/assets/stylesheets directory, with the name you want, but with the extension .css.scss, and place in it the following line:
#import "bootstrap";
Also if you need to use the javascript helpers from bootstrap, you need to add the following line in your app/assets/javascript/application.js file:
//= require bootstrap
Just download the bootstrap ( CSS, JS ) file and make the updation in that file at regular interval from his official site : Bootstrap
For Bootstrap Tutorials : Click Here
Or you can refer the sample code for reference, because sometimes we dnt get the way to implement such functionality like tooltip.
I want use both jquery ui and bootstrap , there is a solution
jquery-ui-bootstrap
and you must load bootstrap before jqueryui, if you won't there will apear something wrong . eg: Bialog buttons will be lose style.
but there is another error when you use radio-button if you load bootstrap before jquery.
another question about this
so? Should bootstrap.js run after jquery.js or before?
I'm pretty sure you should load jQuery first because Bootstrap uses jQuery features.
I tried to load jquery.js first, and my code is runing propertly. Try it and tell us the result, otherwise, we don't know how to help you...
I've got a Ruby on Rails app running with Bootstrap, which I installed using the gem twitter-bootstrap-rails.
I'd now like to integrate a new Bootswatch theme, but I'm having trouble figuring out what to do.
There are four possible downloads for each theme - a bootstrap.css file, a bootstrap.min.css file, a variables.less file, and a bootswatch.less. My question is: do I need to download and add them ALL to my ~/app/assets/stylesheets folder? or do I just need a subset of those? Currently inside ~/app/assets/stylesheets are just two files: application.css and boostrap_and_overrides.css.less. LESS really throws me off here so I'm totally confused with how it works and what I need to do to add new css files with this setup. Any help is appreciated.
You only need to download the bootstrap.css file, and rename it. The bootstrap.min.css is the same as the css file just a minified version of it. Less is just another way of writing css and accessing each property differently. Check out less. Add css file and begin integrating into html, also point html to new stylesheet.
Here's a twitter bootstrap gem for easy Bootswatch theme integration/customization for rails:
https://github.com/scottvrosenthal/twitter-bootswatch-rails