Rails plugin that inserts a facebook-style select for an input field
JavaScript Ruby
Permalink
Failed to load latest commit information.
lib
public
tasks
MIT-LICENSE
README.rdoc
init.rb

README.rdoc

FacebookSelect

Adds helper method for creating facebook style selectors. (devthought.com/projects/mootools/textboxlist/)

Installation

  • rake facebook_select:install

  • Make sure protomultiselect.css and facebooklist.js are included in the HTML head tag

Example

facebook_select_tag('idea[tag_list]', suggested_tags_path(:format => 'js'), @suggested_tags, :hint => 'Type tags')

In the controller, have a function that returns the JSON for the input:

def suggested_tags
  @suggested_tags = %w(facebook selector)
  respond_to do |wants|
    wants.js { render :inline => @suggested_tags.map { |tag| {:caption => tag, :value => tag} }.to_json }
  end
end

Copyright © 2009 Innovation Factory, released under the MIT license