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

bootstrap_datepicker

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bootstrap_datepicker

  • 0.7
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

= Bootstrap Datepicker Rails plugin

This gem allows you to use a beautifull twitter-bootstrap themed date picker on date fields via a simple form helper.

This gem packs Stefan Petre's amazing jQuery/Bootstrap plugin (http://www.eyecon.ro/bootstrap-datepicker/) with a simple Rails interface.

== Getting Started

for Rails >= 3.1:

  1. Insert into your Gemfile:

    gem 'bootstrap_datepicker'

  2. If you are using Rails 3.1 with the asset pipeline enabled (default), the necessary files are already in your asset pipeline.

Just add (if they are not already there) to your app/assets/javascripts/application.js:

//= require jquery
//= require jquery-ujs
//= require jquery-ui
//= require twitter/bootstrap
//= require bootstrap-datepicker

The same applies for app/assets/stylesheets/application.css

*= require bootstrap-datepicker

== Usage

Add this to your view.

<%= datepicker_input "user", "birthday" %>

Where "user" is your model name and "birthday" the name of the datefield.

You can also use it with the form helper like:

<% form_for(@user) do |f| %>
  <%= f.datepicker 'birthday' %>
  <%= f.submit 'Create' %>
<% end %>

Nested attributes are permitted as well:

<% form_for(@user) do |f| %>
  <% f.fields_for(@nested) do |f2| %>
    <%= f2.datepicker 'birthday' %>
  <% end %>
  <%= f.submit 'Create' %>
<% end %>

You can pass options as it would be a normal text_field, plus all the datepicker options available (http://www.eyecon.ro/bootstrap-datepicker/)

<%= datepicker_input(:foo, :att1,
        :format => 'mm/dd/yy',
        :week_start => 0, 
        :view_mode => 'years', 
        :min_view_mode => 'days') %>

== Support

Open an issue in https://github.com/derekstavis/bootstrap_datepicker if you need further support or want to report a bug

FAQs

Package last updated on 15 Jan 2013

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