My favorites | Sign in
Project Logo
          
Search
for
Updated Jul 10, 2008 by cainlevy
Labels: Featured
Install  
Installing and setting up RecordSelect in your own Rails application.

PREPARING

  1. Install Paginator
  2. sudo gem install paginator
  3. Make sure you are including Prototype from your layout:
  4. <%= javascript_include_tag :defaults %>

INSTALL

  1. Download from GitHub and unzip into vendor/plugins.
  2. Then add the CSS and JavaScript to your layout by including the following line:
  3. <%= record_select_includes %>
  4. Enable and configure it on a controller.
  5. class UsersController < ApplicationController
    record_select :per_page => 5, :search_on => 'username'
    end
  6. Optional: to use RecordSelect RESTfully, add the following to your routes.rb:
  7. map.resources :model_id, :collection => {:browse => :get}, :member => {:select => :post}
  8. Now go ahead and use it somewhere.

Comment by wilter, Mar 01, 2008

I installed the plugin, and it really works excellent.

Just for the newbies, like me, would be nice to add some comments to the Install documentation.

1.Add: you must add "require 'paginator'" at the end of config/environment.rb

2.Add: you must also include <%= javascript_include_tag :defaults %> in application.rhtml or in the <controller>.html.erb

4. :model_id is just a "placeholder", really you must add the real model name in router.rb, example: map.resources :users, :collection => {:broswe.......etc AND you MUST add it BEFORE others map.resources (i believe)

Finally, dear friends nuwbies, if everythings goes wrong, read the demo application sources: http://code.google.com/p/recordselect/source/browse/demo

Thanks Lance, excellent job, as always.

Wilter.

Comment by cainlevy, Mar 03, 2008

Thanks Wilter, I'll merge some of that into the wiki's page.


Sign in to add a comment
Hosted by Google Code