Sha256: 486feb41776a42c9fa9025fcdc21263330443eb9db82ddc699dd98bb959264c2

Contents?: true

Size: 642 Bytes

Versions: 3

Compression:

Stored size: 642 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

3 entries across 3 versions & 1 rubygems

Version Path
dust-generators-0.2.6 lib/generators/dust/albums/templates/app/controllers/view_albums_controller.rb
dust-generators-0.2.5 lib/generators/dust/albums/templates/app/controllers/view_albums_controller.rb
dust-generators-0.2.4 lib/generators/dust/albums/templates/app/controllers/view_albums_controller.rb