Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Rajkumar S

« Newer Snippets
Older Snippets »
Showing 1-3 of 3 total  RSS 

Install DateBocks

Install engines plugin

./script/plugin source http://svn.rails-engines.org/plugins/
./script/plugin install engines


Install datebocks

./script/plugin source http://svn.toolbocks.com/plugins
./script/plugin install datebocks_engine

Select field from database with option selected

to post sess[callcenter_client_id]

select("sess", "callcenter_client_id", CallcenterClient.find_all.collect {|p| [ p.name, p.id ] }, { :selected => @sess.callcenter_client_id.to_i })


make sure that the :selected entry is an integer.

Render partial

<%= render(:partial         => "animal" ,
           :collection      => %w{ ant bee cat dog elk },
           :spacer_template => "spacer" )
%>

animal is the name of template and local variable holding each element of collection inside the partial. animal_counter holds the index of current element in the collection. spacer_template is rendered between each elements in the collection.
« Newer Snippets
Older Snippets »
Showing 1-3 of 3 total  RSS