rubyonrailsin

A Ruby and Rails talk

Wednesday, March 31, 2010


[Rails] Re: undefined method error

by rubyonrailsin 0 comments

Tag


Share this post:
Design Float
StumbleUpon
Reddit

Gautam wrote:
> Thanks for your kind reply.
> Here is the code of my routes.rb file
> Please suggest corrections, if any...
>
> map.resources :notices
> map.resources :users, :has_many => :notices
> map.resource :session
>
> map.connect ':controller/:action/:id'
> map.connect ':controller/:action/:id.:format'
> map.connect '/notices/:id/:abc', :controller => "notices", :action
> => "abc"
>
> map.root :controller=> 'welcome'
> map.signup '/signup', :controller => 'users', :action => 'new'
> map.login '/login', :controller => 'sessions', :action => 'new'
> map.logout '/logout', :controller => 'sessions', :action =>
> 'destroy'
> map.create '/create', :controller => 'notices', :action => 'new'

try this out. Change

map.connect '/notices/:id/:abc', :controller => "notices", :action
> => "abc"

to

map.abc_notice '/notices/:id/:abc', :controller => "notices", :action
> => "abc"


Then when you call abc_notice_path(4, 'alphabet')

Maybe that will help out.
--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment

Subscribe feeds via e-mail

Blog Archive