Created
November 27, 2012 21:45
-
-
Save twestonkendall/4157296 to your computer and use it in GitHub Desktop.
trying to get wicked routes to work
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
if @asset.save | |
redirect_to team_asset_asset_steps_path(@team, @asset) | |
# redirect_to team_path(@asset.team), :notice => "Your media was saved." | |
else | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resources :teams, :path => '', :except => [:index] do | |
... | |
resources :assets, :path => '' do | |
resources :asset_steps | |
... | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Started GET "/video-pros/213/asset_steps" for 127.0.0.1 at 2012-11-27 13:40:55 -0800 | |
Processing by AssetStepsController#index as HTML | |
Parameters: {"team_id"=>"video-pros", "asset_id"=>"213"} | |
Redirected to http://0.0.0.0:3000/asset_steps/files | |
Completed 302 Found in 1ms | |
Started GET "/asset_steps/files" for 127.0.0.1 at 2012-11-27 13:40:55 -0800 | |
Processing by AssetStepsController#show as HTML | |
Parameters: {"id"=>"files"} | |
Completed 404 Not Found in 44ms | |
ActiveRecord::RecordNotFound (Couldn't find Asset without an ID): | |
app/controllers/asset_steps_controller.rb:6:in `show' |
is this what you meant?
team_asset_asset_step_path(:team_id => @team.id, :asset_id => @asset.id, :id => "files")
yep, something along those lines should work. Just run rake routes
to make sure you're using the right helper. I might suggest chaining your wizard controller to be named something else like "builder" or something along those lines so it would be team_asset_builder_path.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not sure if the index action is forwarding params properly, there might be a bug in there. You can use the direct path helper instead: