Sha256: 14447b1b1a6a8f7485b83203065e02d5d1652776e762d5aa80fb32fa16e8a81d
Contents?: true
Size: 1.06 KB
Versions: 10
Compression:
Stored size: 1.06 KB
Contents
module Kuztuscms class ArticlesController < KuztuscmsController # GET /articles def index @articles = Article.all end # GET /articles/1 def show @article = Article.find(params[:id]) end # GET /articles/new def new @article = Article.new end # GET /articles/1/edit def edit @article = Article.find(params[:id]) end # POST /articles def create @article = Article.new(params[:article]) if @article.save redirect_to articles_url, notice: 'Article was successfully created.' else render action: "new" end end # PUT /articles/1 def update @article = Article.find(params[:id]) if @article.update_attributes(params[:article]) redirect_to articles_url, notice: 'Article was successfully updated.' else render action: "edit" end end # DELETE /articles/1 def destroy @article = Article.find(params[:id]) @article.destroy redirect_to articles_url end end end
Version data entries
10 entries across 10 versions & 1 rubygems