app/controllers/works_controller.rb
def index_page_title
    if @owner.present?
      owner_name =
        case @owner.class.to_s
        when 'Pseud'
          @owner.name
        when 'User'
          @owner.login
        when 'Collection'
          @owner.title
        else
          @owner.try(:name)
        end

      "#{owner_name} - Works".html_safe
    else
      "Latest Works"
    end
  end
# only registered users and NOT admin should be able to create new works
only registered users and NOT admin should be able to create new works
only registered users and NOT admin should be able to create new works
def index_page_title
    if @owner.present?
      owner_name =
        case @owner.class.to_s
        when 'Pseud'
          @owner.name
        when 'User'
          @owner.login
        when 'Collection'
          @owner.title
        else
          @owner.try(:name)
        end
      "#{owner_name} - Works".html_safe
    else
      "Latest Works"
    end
  end
def index_page_title if @owner . present? owner_name = case @owner . class . to_s when 'Pseud' @owner . name when 'User' @owner . login when 'Collection' @owner . title else @owner . try ( :name ) end "#{owner_name} - Works" . html_safe else "Latest Works" end end
only registered users and NOT admin should be able to create new works
only registered users and NOT admin should be able to create new works