No CSS for jquery_datepicker in Rails 3.2.x app - ruby-on-rails-3

I am using jQuery datepicker gem in a Rails 3.2.x app and the calendar looks like there is no CSS applied to it.
I have required all jQuery related JS files in my application.js
//= require jquery
//= require jquery_ujs
//= require jquery-ui
I also followed the simple instructions in the ReadME for the gem.
I was under the impression that once I required it in my application.js, then everything should be included.
What am I missing?

This is because you're not including the CSS assets as well. Simply including the JavaScript assets is not enough to get it styled.
As the jquery-rails README states:
In order to use the themed parts of jQuery UI, you will also need to supply your own theme CSS (or use the jquery-ui-rails gem mentioned above).

Related

Would it be possible to use JQuery Bootstrap framework along with Aurelia?

Would it be possible to use jQuery Bootstrap with Aurelia? There are some toggle buttons and other components I would like to use that come with Bootstrap.
So far, all of the examples I have seen are using jQuery UI along with Aurelia.
Take a look at the skeleton-navigation project. It uses bootstrap by default:
https://github.com/aurelia/skeleton-navigation/tree/master/skeleton-es2016
The magic happens here
https://github.com/aurelia/skeleton-navigation/blob/master/skeleton-es2016/src/main.js#L1
import 'bootstrap';
Note that bootstrap is installed via JSPM.

Use Haml in rails plugin

I have made a mountable plugin using haml as template. I have added haml and haml-rails in my gemspec.
I use it in a project, I add it in my Gemfile as follows:
gem 'my_plugin', :git=> "git#github.com:lishoubo/my_plugin.git"
after execute bundle install, I see the haml and haml-rails have been installed.
But when I start the server, It prompts error:
Missing template
It seems the the project can not load haml gem event it install them. I guess it because the haml gems are installed for plugin not for the project. So I add haml and haml-rails to project Gemfile. It dose work.
However, I do not think it needs to add haml gem "again" to project Gemfile. Because I use a plugin, and this plugin uses haml, why I should add it to my Gemfile?
Does anyone know why?

Rails 3.2 Asset Pipeline, CarrierWave and .gitignore

I'm using CarrierWave gem and Rails 3.2. When in production, Rails requires me to pre-compile the user image folder.
Currently my CarrierWave upload images to public/assets/images and I'm ignoring public folder in .gitignore.
Is there a better practice for this?
This question and answers provide you with better options for managing CarrierWave upload images

Rails 3 - paperclip with perloader

I use for upload my images Paperclip. I would like to ask you, if exist any gem or plugin for showing the preloader while the image is uploading (something like "56% loaded").
it doesn't have to do anything with paperclip actually.
I am using mootools, with mootools I am using FancyUpload which has lots of options and is very well written and easy to debug, rewrite, extend etc...
When you use this, you get an "Ajax" upload with a progress bar.
if you are using jQuery, there are many plugins for that as well.
it's very easy to integrate into the project.

Rails 3.1: Do I need to use CoffeeScript?

Do I need to use CoffeeScript instead of JS in a Rails 3.1 app? The same goes for SASS and CSS.
thanks
No you don't. Just remove the coffeescript and sass gems in the Gemfile and you are good to go.