def create @message = Message.new(params[:message]) @message.set_sticky current_user.messages << @message @section.messages << @message build_annex(params) respond_to do |format| ActiveRecord::Base::transaction do begin @message.save! @annex.save! @file_revision.save! @section.save! flash[:notice] = translate(:'message created with success', :title=>@message.title) format.html { redirect_to :action=>'index' } rescue format.html { render :action => "new" } raise ActiveRecord::Rollback end end end end
blog comments powered by Disqus
Notes

