Hello, I am trying to clean and dry up my controllers with my postbacks with the following code in my controller: def edit @music = Music.find_by_id(params[:id]) || Music.new if request.post? @music.attributes = params[:music] redirect_to :controller => 'client', :action => 'show', :id => session[:client] and return if @music.save end end Now when I create a new album, it works fine, but when I try to edit it, this is the error I get: no route found to match "/music/edit/edit/3" Why isn't my code doing my edit properly? Thanks, M
on 2007-07-23 19:24
on 2007-07-26 00:46
you might want to skip this recipe, since it no longer applies for RESTful routes.. New and edit now use separate actions.. Mike
on 2007-07-26 01:20
Mike Garey wrote: > you might want to skip this recipe, since it no longer applies for > RESTful routes.. New and edit now use separate actions.. > > Mike Oh ok thanks.