Sha256: 43b5453b3f4188969eb839e641bd2c050fb85b7de6b421f9f90dbc505983543f

Contents?: true

Size: 658 Bytes

Versions: 4

Compression:

Stored size: 658 Bytes

Contents

class View<%=parent_plural_class_name%>Controller < ApplicationController

  def index
		@<%=parent_plural_name%> = <%=parent_class_name%>.page(params[:search], 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.2.3 rails_generators/dust_albums/templates/app/controllers/view_albums_controller.rb
dust-generators-0.2.2 rails_generators/dust_albums/templates/app/controllers/view_albums_controller.rb
dust-generators-0.2.1 rails_generators/dust_albums/templates/app/controllers/view_albums_controller.rb
dust-generators-0.2.0 rails_generators/dust_albums/templates/app/controllers/view_albums_controller.rb