Created
May 1, 2009 15:29
-
-
Save jeromegn/105090 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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