Class | PagesController
In: | app/controllers/pages_controller.rb
Parent: | ApplicationController

### Methods

index show

### Public Instance methods

index()

[Source]

        # File app/controllers/pages_controller.rb, line 4
     4:     def index
     5:       @title = t('documents.Pages')
     6:       @pages = Page.published.paginate :page => params[:page],  :order => 'published_at DESC'
     7:       respond_to do |format|
     8:         format.html
     9:         format.rss {render :layout => false}
    10:       end
    11:     end

show()

[Source]

        # File app/controllers/pages_controller.rb, line 13
    13:     def show
    14:       begin
    15:         @page = Page.published.find(params[:id])
    16:       rescue ActiveRecord::RecordNotFound
    17:         if is_admin?
    18:           @page = Page.find(params[:id])
    19:         else
    20:           raise ActiveRecord::RecordNotFound
    21:         end
    22:       end
    23:
    24:       if @category
    25:         # Comprobar que la categoria y el documento estan relacionados
    26:         if @page.tags.private.collect(&:name_es) & @category.tags.private.collect(&:name_es) == []
    27:           logger.info "Categoria y documento no relacionados"
    28:           raise ActiveRecord::RecordNotFound
    29:         end
    30:       end
    31:
    32:       respond_to do |format|
    33:         format.html {
    34:           render
    35:         }
    36:         format.iphone {
    37:           render :layout => false
    38:         }
    39:       end
    40:
    41:     end

[Validate]