Sha256: a076c0ad838356d9d7fd13764c8cfbfb1084ba7d76073ce5caf5607ab33ec907

Contents?: true

Size: 512 Bytes

Versions: 4

Compression:

Stored size: 512 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: :object, 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

4 entries across 4 versions & 1 rubygems

Version Path
myrails-1.1.0 lib/myrails/templates/presenters/presenter.rb
myrails-1.0.2 lib/myrails/templates/presenters/presenter.rb
myrails-1.0.1 lib/myrails/templates/presenters/presenter.rb
myrails-1.0.0 lib/myrails/templates/presenters/presenter.rb