Date Pickers in Rails (Internet Explorer and other browsers)
I was using the date_select for entering dates in Rails apps. For most browsers such as Chrome and Firefox, it works perfectly. The user can use a mini pop up calendar to select the date.
The browser gem allows you to do things like ‘if browser.ie?’ plus a LOT more.
Since the application I am currently developing is behind a firewall with a limited number of machines and browsers, the following works fine in the view (The date picker is in the view to change the date range of the report. )
<% if browser.ie? then %>
From Date: <%= date_select :from, :post %>
To Date:<%= date_select :to,:post %>
<% else %>
From Date: <%= date_field_tag ‘from’ %>
To Date: <%= date_field_tag ‘to’ %>
<% end %>
With the code above, the limited date_select will show if the user is running IE and the better date_field_tag will show for other browsers.
- Use Rake Notes instead of Git Grep to get a list of notes in your rails project
- Viewing your SQLLite Data (Ruby on Rails beginners)
- Ruby on Rails – Show a field only if the controller is ‘new’
- Setting up an SSLcertificate for Github in windows.
- Shading Cells in Ruby depending on the contents of the cell
- Fixing the “Leverage browser caching” and “Enable Compression” from Google Page Speed in Joomla
- Setting browser caching
- Creating Entity Relationship Diagrams in Rails.