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

Version Path
kuztuscms-0.0.10 app/controllers/kuztuscms/articles_controller.rb
kuztuscms-0.0.9 app/controllers/kuztuscms/articles_controller.rb
kuztuscms-0.0.8 app/controllers/kuztuscms/articles_controller.rb
kuztuscms-0.0.7 app/controllers/kuztuscms/articles_controller.rb
kuztuscms-0.0.6 app/controllers/kuztuscms/articles_controller.rb
kuztuscms-0.0.5 app/controllers/kuztuscms/articles_controller.rb
kuztuscms-0.0.4 app/controllers/kuztuscms/articles_controller.rb
kuztuscms-0.0.3 app/controllers/kuztuscms/articles_controller.rb
kuztuscms-0.0.2 app/controllers/kuztuscms/articles_controller.rb
kuztuscms-0.0.1 app/controllers/kuztuscms/articles_controller.rb