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

combo_box

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

combo_box

  • 0.0.12
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= ComboBox

Adds helpers for Rails views and controller in order to manage 'dynamic select'. It uses jQuery UI as support for inobtrusive use in forms. It's not the classic Autocompleter, its use is limited to belongs_to reflections.

== Rails 3.0

ComboBox requires the gem +jquery-rails+, so if you don't already use it: rails generate jquery:install --ui

Then install +combo_box+ in your app like +jquery-rails+: rails generate combo_box:install

Then the javascript and/or stylesheet files must be included in the application layout: <%= javascript_include_tag('combo_box') -%> <%= stylesheet_link_tag('combo_box') -%>

== Rails 3.1

Nothing to install. With the asset pipeline, there is no need to run generators or copy files. So for stylesheets:

app/assets/stylesheets/application.css

*= require combo_box

And for javascripts:

app/assets/javascripts/application.js

*= require combo_box

== Usage

Classic usage in resource forms:

app/controllers/orders_controller.rb

class OrdersController < ApplicationController search_for :client end

app/views/orders/_form.html.haml

combo_box :order, :client

Usage in non-resource forms with personalized controller method:

app/controllers/orders_controller.rb

class OrdersController < ApplicationController def search_for_orders orders = Order.find_all_by_number(params[:term]) render orders.collect{|r| {:label=>r.number, :id=>r.id}}.to_json end end

app/views/orders/search.html.haml

combo_box_tag "search", :search_for_orders

== Contributing to ComboBox

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
  • Fork the project
  • Start a feature/bugfix branch
  • Commit and push until you are happy with your contribution
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

== Copyright

Copyright (c) 2011 Brice Texier. See LICENSE.txt for further details.

FAQs

Package last updated on 25 Sep 2012

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