app/admin/story.rb
# This code is evaluated within the controller class
This code is evaluated within the controller class
This code is evaluated within the controller class
def create
      id = params[:id]
      if !Story.exists?(id)
        s = Story.create!(story_params)
        if s.save!
          redirect_to admin_story_path(s)
        else
          render "new"
        end
      else
        render "new"
      end
    end
def create id = params [ :id ] if ! Story . exists? ( id ) s = Story . create! ( story_params ) if s . save! redirect_to admin_story_path ( s ) else render "new" end else render "new" end end
This code is evaluated within the controller class
This code is evaluated within the controller class
#s = Story.new(story_params) #s.update_attributes(story_params)