Skip to content

Instantly share code, notes, and snippets.

@jeromegn
Created May 1, 2009 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeromegn/105090 to your computer and use it in GitHub Desktop.
Save jeromegn/105090 to your computer and use it in GitHub Desktop.
class Participation::ArticlesController < Participation::ApplicationController
def new
@article || @article = Article.new
end
def create
@article = Article.new(params[:article])
respond_to do |format|
if @article.save
flash[:notice] = "Article sauvegardé avec succès!"
format.html { redirect_to edit_participation_article_path(@article) }
else
format.html { render :action => "new" }
end
end
end
def edit
@article = Article.find(params[:article])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment