Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

formtastic_datepicker_inputs

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

formtastic_datepicker_inputs

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

FormtasticDatepickerInputs

This plugin is based off of a blog post by Grzegorz Brzezinka: http://blog.brzezinka.eu/webmaster-tips/ruby/ruby-on-rails-formtastic-jquery-ui-datepicker

The concept is simple. It adds a new input into formtastic that can be used like this:
<% semantic_form_for @master do |f| -%> <% f.inputs do -%> <%= f.input :name %> <%= f.input :born, :as => :date_picker %> <% end -%> <%= f.buttons %> <% end -%>

It adds a class onto a normal text input called 'ui-date-picker', and the parent

  • it adds a class called 'date_picker.' Assuming you have already referenced jquery, and jqueryui in your layout, You can then hook this with a call from jquery:

    $(document).ready(function(){ $('input.ui-date-picker').datepicker(); });

    Development Environment

    We currently support both Rails 2 and Rails 3, under Ruby 1.8.7-ish (and 1.9.2-ish). That means, at a bare minimum, you'll want to set-up two rvm gemsets to run your specs against. So, fork the project on Github, clone it, make some gemsets, run bundler, run your specs and then finally set-up an .rvmrc file that specifies Rails 3 as your default gemset and cd back into that directory to load in the .rvmrc file. Something like this:

      $ cd ~/code/formtastic
      $ rvm gemset create formtastic-rails3
      $ rvm gemset use formtastic-rails3
      $ gem install bundler
      $ bundle install
      $ rake spec
      $ rm Gemfile.lock
      $ rvm gemset create formtastic-rails2
      $ rvm gemset use formtastic-rails2
      $ gem install bundler
      $ RAILS_2=true bundle install
      $ RAILS_2=true rake spec
      $ touch .rvmrc
      $ echo "rvm gemset use formtastic-rails-3" > .rvmrc
      $ cd ~/code/formtastic
    

    Also, most of the testing environment has been copied straight of formtastic, so if something doesn't make sense here, it probably did where I grabbed it from.

    Contributors

    • Grzegorz Brzezinka
    • Nik Petersen
    • Alan Harper
  • FAQs

    Package last updated on 30 Nov 2010

    Did you know?

    Socket

    Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

    Install

    Related posts

    SocketSocket SOC 2 Logo

    Product

    • Package Alerts
    • Integrations
    • Docs
    • Pricing
    • FAQ
    • Roadmap
    • Changelog

    Packages

    npm

    Stay in touch

    Get open source security insights delivered straight into your inbox.


    • Terms
    • Privacy
    • Security

    Made with ⚡️ by Socket Inc