Displaying 1 result from an estimated 1 matches for "puzzle_path".
2007 May 22
3
Comments wanted about spec''ing out a couple controller methods
...ser
def create
@puzzle = Puzzle.new(params[:puzzle])
@puzzle.user = @user
@media = Media.new(:uploaded_data => params[:media])
Puzzle.transaction do
@puzzle.media = @media
@puzzle.save! && @media.save!
flash[:notice] = "Success!"
redirect_to puzzle_path(@puzzle)
end
rescue ActiveRecord::RecordInvalid => e
@media.valid? # force checking of errors even if @puzzle.save!
failed
flash[:error] = "Problem submitting the One Word Wonder..."
render :partial => ''new'', :layout => true
end
def update
@pu...