Sha256: 6eaab6cac734f8574225c51956c160c506a39f9e32e3e04981737efd5a8693c5

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 KB

Contents

class MainController < ApplicationController

  # Default behavior
  def index
    render :inline => 'Main#index', :layout => 'application'
  end


  # Override controller
  def show
    js 'OtherMain', :x => 1
    render :inline => 'Main#show', :layout => 'application'
  end


  # Override action
  def new
    js :otherAction, :x => 1
    render :inline => 'Main#new', :layout => 'application'
  end


  # Override controller/action
  def edit
    js 'OtherMain#otherAction', :x => 1
    render :inline => 'Main#edit', :layout => 'application'
  end


  # Stop paloma from execution
  def prevent
    js false
    render :inline => 'Main#prevent', :layout => 'application'
  end


  def basic_params
    js :x => 1, :y => 2
    render :inline => 'Main#basic_params', :layout => 'application'
  end





  #
  # Non-HTML response
  #

  def json_response
    render :json => {:x => 1}
  end


  def js_response
    render :js => 'alert(1);'
  end


  def xml_response
    render :xml => '<?xml version="1.0" encoding="UTF-8"?><note>test</note>'
  end


  def file_response
    render :file => "#{Rails.root}/Gemfile"
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
paloma-4.1.2 test_app/app/controllers/main_controller.rb