Sha256: 6a29a0afe60c3d040e318a1dd6acd4b2967cede8e087a432309fe6c8e0f78973

Contents?: true

Size: 1.09 KB

Versions: 7

Compression:

Stored size: 1.09 KB

Contents

# Dummy Controllers
class ApplicationController < ActionController::Base
end


class ArticlesController < ApplicationController

  def index
    @articles = Article.all
    js_callback :params => {:article_count => @articles.size}
  end
  

  def show
    @article = Article.find params[:id]
  end
  
  
  def new
    @article = Article.new
  end
  
  
  def create
    @article = Article.new params[:article]
       
    if @article.save
      redirect_to @article
    else
      js_callback :new
      render :new
    end
  end
  
  
  def edit
    @article = Article.find params[:id]
    render :new
  end
  
  
  def update
    @article = Article.find params[:id]
    
    if @article.update_attributes params[:article]
      js_callback false
      redirect_to @article
    else
      js_callback :controller => :articles, :action => :edit
      render :new
    end
  end
  
end

module SampleNamespace
  class CategoriesController < ApplicationController
    def index
      @categories = Category.all
    end
    
    
    def new
      @category = Category.new
      js_callback :index
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
paloma-1.2.6 spec/sample_app/controllers.rb
paloma-1.2.5 spec/sample_app/controllers.rb
paloma-1.2.4 spec/sample_app/controllers.rb
paloma-1.2.3 spec/sample_app/controllers.rb
paloma-1.2.2 spec/sample_app/controllers.rb
paloma-1.2.1 spec/sample_app/controllers.rb
paloma-1.2.0 spec/sample_app/controllers.rb