All pastes #35317 Raw Edit

RaydenUni

public ruby v1 · immutable
#35317 ·published 2005-12-30 21:18 UTC
rendered paste body
  def create    @flat_page = FlatPage.new(params[:flat_page])    @org_relation = OrgRelation.new(params[:org_relation])    @org = Org.new(:content_type_id => 1,                     :content_id => @flate_page.id, #this should be the id of @flat_page                    :page_title => "My Title!",                     :is_menu_item => 0)    if @flat_page.save        flash[:notice] = 'FlatPage was successfully created.'        if @org_relation.save            flash[:notice] = 'org_relation was successfully created.'            if @org.save                flash[:notice] = 'org was was successfully created.'            end        end        redirect_to :action => 'list'    else      render :action => 'new'    end  end