Class: Views::Groups::Form
- Inherits:
-
Base
- Object
- Base
- Views::Groups::Form
- Includes:
- Phlex::Rails::Helpers::FormWith
- Defined in:
- app/views/groups/form.rb
Instance Method Summary collapse
- #before_template ⇒ Object
-
#initialize(creator:, group:) ⇒ Form
constructor
A new instance of Form.
- #view_template ⇒ Object
Constructor Details
#initialize(creator:, group:) ⇒ Form
Returns a new instance of Form.
6 7 8 9 |
# File 'app/views/groups/form.rb', line 6 def initialize(creator:, group:) @creator = creator @group = group end |
Instance Method Details
#before_template ⇒ Object
11 12 13 |
# File 'app/views/groups/form.rb', line 11 def before_template @group.memberships.build if @group.memberships.empty? end |
#view_template ⇒ Object
15 16 17 18 |
# File 'app/views/groups/form.rb', line 15 def view_template # Using an ERB form otherwise coccooned doesn't work render partial("form", creator: @creator, group: @group) end |