Hey all,

Rails guide doesnt cover with_options in Rails 3:

http://guides.rubyonrails.org/routing.html

The book The Rails 3 Way makes no reference to with_options except for
one page briefly.

And I cannot find a decent tutorial to cover what I am trying to do.

I have this:

map.with_options :name_prefix => "dashboard_", :path_prefix =>
"dashboard", :controller => "dashboard" do |dashboard|
    dashboard.sidebar ".:format"
    dashboard.charts ".:format"
    dashboard.action_items ".:format"
    dashboard.performance ".:format"
    dashboard.site_menu ".:format"
    dashboard.quick_links ".:format"
    dashboard.perf_randomizations ".:format"
  end

Basically all of these methods "sidebar", "charts", etc are all methods
of the dashboard controller. I want them all to have a path helper of
dashboard_#{action}_url, where action is the action (e.g.
dashboard_sidebar_url). I want them all to be able to respond to both
html format and json. However, I dont know how to do this in Rails 3.

The above code raises exception:

config/routes.rb:7:in `block in <top (required)>': undefined local
variable or method `map' for
#<ActionDispatch::Routing::Mapper:0x00000102ca3570> (NameError)


Some stackoverflow posts show similar situations but not specifically
what I am trying to do here.

thanks for response

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to