Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

94646 nested form manager fix #580

Merged
merged 3 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions lib/generators/fae/nested_scaffold_generator.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require_relative 'base_generator'
module Fae
class NestedScaffoldGenerator < Fae::BaseGenerator
source_root ::File.expand_path('../templates', __FILE__)
Expand Down Expand Up @@ -38,12 +39,12 @@ def generate_view_files

def inject_parent_info
inject_into_file "app/models/#{file_name}.rb", after: "BaseModelConcern\n" do <<-RUBY
\n belongs_to :#{options.parent_model.underscore}, touch: true
\n belongs_to :#{options.parent_model.underscore}, touch: true

def fae_nested_parent
:#{options.parent_model.underscore}
end
RUBY
def fae_nested_parent
:#{options.parent_model.underscore}
end
RUBY
end
end

Expand Down
3 changes: 3 additions & 0 deletions lib/generators/fae/templates/views/_form_nested.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ ruby:

= f.submit
= button_tag 'Cancel', type: 'button', class: 'js-cancel-nested cancel-nested-button'

- if Fae.use_form_manager
a.button.js-launch-form-manager href='#' = t('fae.form.launch_form_manager')