In the controller I have actions new, create, new_recording and create_recording In routes.rb new_recording is GET and create_recording is POST
When I click on the get link to create a new recording action controller responds saying:
The action 'new_recording' could not be found for UserPressReleasesController
<%= link_to 'New recording/album press release', new_user_recording_path(artist_id: @artist.id) %>
get 'artists/:artist_id/new_recording_press_release' => 'user_press_releases#new_recording', as: 'new_user_recording'
post 'artists/:artist_id/new_recording_press_release' => 'user_press_releases#create_recording', as: 'create_user_recording'
def new_recording
@press_release = PressRelease.new
end
def create_recording
@press_release.publicist= "@press_release.user.first_name @press_release.user.last_name"
@press_release = PressRelease.new(press_release_params)
respond_to do |format|
if @press_release.save
format.html { redirect_to user_press_releases_path, notice: 'Press release was successfully created.' }
format.json { render :show, status: :created, location: @press_release }
else
format.html { render :new_recording }
format.json { render json: @press_release.errors, status: :unprocessable_entity }
end
end
end
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/fef7f4bf-c458-45d9-9f6a-507efbc224ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment