Forum: Ruby on Rails with_options

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
661ae6e97d0e16c2af2aaf7d197e8387?d=identicon&s=25 Sijo k g (sijo)
on 2009-01-05 05:53
Hi
   why is this used in routes.rb I have code like below But I did not
understand what it means Could anybody please clarify this?

map.with_options(:controller => "companies") do |companies_map|

companies_map.companies_view_custom_field_permissions
'/companies/view_custom_field_permissions',
     :action => 'view_custom_field_permissions'

companies_map.with_options(:my_company => true) do |my_company_map|
      my_company_map.my_company
'/my_company/:company_id',                  :action => 'show',
:company_id => 'root'

end

end

Thanks in advance
Sijo
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-01-05 10:24
(Received via mailing list)
On Jan 5, 4:53 am, Sijo Kg <rails-mailing-l...@andreas-s.net> wrote:
> Hi
>    why is this used in routes.rb I have code like below But I did not
> understand what it means Could anybody please clarify this?
>

http://www.spacevatican.org/2008/11/25/with_option...

Fred
661ae6e97d0e16c2af2aaf7d197e8387?d=identicon&s=25 Sijo k g (sijo)
on 2009-01-05 11:09
Hi
    Thanks for the link..Also have doubts on why to specify collection,
path_prefix etc For example

map.resources :projects, :collection => { :all => :get, :my => :get,
:search_all => :post, :search_my => :post } do |projects|

And here in above resources is projects as well as the local variable
also is |projects| So Is it not a problem? What does the above mean

Sijo
This topic is locked and can not be replied to.