Sha256: ae108d14472756b73577667f8a43447e191f4ec994e6ea245d68fa55b000cf37

Contents?: true

Size: 629 Bytes

Versions: 8

Compression:

Stored size: 629 Bytes

Contents

class <%= plural_table_name.capitalize %>::<%= @view_name.capitalize %>Presenter < Curly::Presenter
  # If you need to assign variables to the presenter, you can use the
  # `presents` method.
  #
  #   presents :foo, :bar
  #
  # Any public method defined in a presenter class will be available
  # to the Curly template as a variable. Consider making these methods
  # idempotent.
  presents :<%= singular_table_name %>

  def <%= singular_table_name %>_form
    render 'form', <%= singular_table_name %>: @<%= singular_table_name %>
  end

  def <%= index_helper %>_link
    link_to 'Back', <%= index_helper %>_path
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
curly-templates-3.4.0 lib/generators/curly/scaffold/templates/new_presenter.rb.erb
curly-templates-3.3.0 lib/generators/curly/scaffold/templates/new_presenter.rb.erb
curly-templates-3.2.0 lib/generators/curly/scaffold/templates/new_presenter.rb.erb
curly-templates-3.1.0 lib/generators/curly/scaffold/templates/new_presenter.rb.erb
curly-templates-3.0.0 lib/generators/curly/scaffold/templates/new_presenter.rb.erb
curly-templates-2.6.5 lib/generators/curly/scaffold/templates/new_presenter.rb.erb
curly-templates-2.6.4 lib/generators/curly/scaffold/templates/new_presenter.rb.erb
curly-templates-2.6.3 lib/generators/curly/scaffold/templates/new_presenter.rb.erb