Sha256: 5287c5b1c6228b94d01ada4ad8147006f0df01375587c3bcefdc272067f3f939

Contents?: true

Size: 867 Bytes

Versions: 12

Compression:

Stored size: 867 Bytes

Contents

class <%= controller_class_name %>Controller < ApplicationController
  # GET /<%= table_name %>
  # GET /<%= table_name %>.xml
  def index
    @<%= table_name %> = <%= class_name %>.paginate :page => params[:page]

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @<%= table_name %> }
    end
  end

  # GET /<%= table_name %>/1
  # GET /<%= table_name %>/1.xml
  def show
    @<%= file_name %> = <%= class_name %>.find_by_permalink(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @<%= file_name %> }
    end
  end
  
  def preview
    @page_id = '<%= table_name %>'
    @page_class = 'show'
    @<%= file_name %> = <%= class_name %>.new(session[:<%= file_name %>_preview])
    session[:<%= file_name %>_preview] = nil
    render :action => "show"
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
beef-acts_as_content_node-0.1.2 generators/content_node_scaffold/templates/view_controller.rb
beef-acts_as_content_node-0.1.3 generators/content_node_scaffold/templates/view_controller.rb
beef-acts_as_content_node-0.1.4 generators/content_node_scaffold/templates/view_controller.rb
beef-acts_as_content_node-0.1.5 generators/content_node_scaffold/templates/view_controller.rb
beef-acts_as_content_node-0.1.6 generators/content_node_scaffold/templates/view_controller.rb
acts_as_content_node-0.1.13 generators/content_node_scaffold/templates/view_controller.rb
acts_as_content_node-0.1.12 generators/content_node_scaffold/templates/view_controller.rb
acts_as_content_node-0.1.11 generators/content_node_scaffold/templates/view_controller.rb
acts_as_content_node-0.1.10 generators/content_node_scaffold/templates/view_controller.rb
acts_as_content_node-0.1.9 generators/content_node_scaffold/templates/view_controller.rb
acts_as_content_node-0.1.8 generators/content_node_scaffold/templates/view_controller.rb
acts_as_content_node-0.1.7 generators/content_node_scaffold/templates/view_controller.rb