Sha256: 3443ae3f2957143231e3101baeddbdbcf1a8c77629d83a225c56e84d5173671c

Contents?: true

Size: 661 Bytes

Versions: 4

Compression:

Stored size: 661 Bytes

Contents

class View<%=parent_plural_class_name%>Controller < ApplicationController

  def index
    @<%=parent_plural_name%> = <%=parent_class_name%>.view(params[:page])
  end

  def show
    if <%=parent_class_name%>.find_by_filename(params[:filename]) == nil
      @<%=parent_singular_name%> = <%=parent_class_name%>.find(:first)
      render :file => "#{RAILS_ROOT}/public/404.html", :layout => false, :status => 404
    else
      @<%=parent_singular_name%> = <%=parent_class_name%>.find_by_filename(params[:filename])
      @<%=child_plural_name%> = @<%=parent_singular_name%>.<%=child_plural_name%>.<%=parent_singular_name%>_page(params[:page])
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dust-generators-0.3.3 lib/generators/dust/albums/templates/app/controllers/view_albums_controller.rb
dust-generators-0.3.2 lib/generators/dust/albums/templates/app/controllers/view_albums_controller.rb
dust-generators-0.3.1 lib/generators/dust/albums/templates/app/controllers/view_albums_controller.rb
dust-generators-0.2.8 lib/generators/dust/albums/templates/app/controllers/view_albums_controller.rb