I'm curious about the following code...
What's happening with the underlined line when the controller receives a GET? There isn't anything in the params hash right? I'm guessing it makes an empty story, but isn't that kind of a waste unless I actually need one (when the request is a POST)?Code:class StoryController < ApplicationController def new @story = Story.new(params[:story]) if request.post? and @story.save flash[:notice] = 'Story submission succeeded' redirect_to :action => 'index' end end end





Bookmarks