Sha256: 73a5d81dd8c7bc2a30b899396657510384d5585d71768566fa5d0ed6ce6f3503

Contents?: true

Size: 526 Bytes

Versions: 9

Compression:

Stored size: 526 Bytes

Contents

# @author Lovell McIlwain
#
# Presenter class for object views
class <%= options[:name].camelize %>Presenter < BasePresenter
  # Reference initialized object_presenter as object
  presents :<%= options[:name]%>

  # delegate :attribute, to: :<%= options[:name]%>, allow_nil: true

  # Return concatenated full name
  def name
    <%= options[:name]%>.attribute + " " + <%= options[:name]%>.attribute
  end

  # Return edit path
  def edit_link
    link_to :Edit, edit_<%= options[:name]%>_path(<%= options[:name]%>)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
myrails-3.2.0 lib/myrails/templates/presenters/presenter.rb
myrails-3.1.0 lib/myrails/templates/presenters/presenter.rb
myrails-3.0.0 lib/myrails/templates/presenters/presenter.rb
myrails-2.2.2 lib/myrails/templates/presenters/presenter.rb
myrails-2.2.1 lib/myrails/templates/presenters/presenter.rb
myrails-2.2.0 lib/myrails/templates/presenters/presenter.rb
myrails-2.1.0 lib/myrails/templates/presenters/presenter.rb
myrails-2.0.0 lib/myrails/templates/presenters/presenter.rb
myrails-1.1.1 lib/myrails/templates/presenters/presenter.rb