Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def loan_application_params
- params.require(:loan_application).permit(:loan_application_id, :business_id, :status, loan_securities_attributes: [:id, :loan_application_id, :security_type, :book_value, :implied_value, :loan_salesforce_id, :type_of_valuation, :other_type_of_valuation, :_destroy])
- end
- # Loan Application Model
- class LoanApplication < ActiveRecord::Base
- has_many :loan_securities, :dependent => :destroy
- accepts_nested_attributes_for :loan_securities, :allow_destroy => true
- # Loan Security Model
- class LoanSecurity < ActiveRecord::Base
- belongs_to :loan_application
- <%= nested_form_for [@business, @loanapplication], method: :put, :class => "form-horizontal", url: wizard_path, :html => { :multipart => true } do |f| %>
- <%= f.fields_for :loan_securities, :wrapper => false do |loan_security| %>
- <%= loan_security.text_field :security_type %>
- <%= loan_security.text_field :book_value %>
- <%= loan_security.text_field :implied_value %>
- <%= loan_security.text_field :type_of_valuation %>
- <%= loan_security.link_to_remove "Delete" %>
- <% end %>
- <%= f.link_to_add "Add a Security", :loan_securities %>
- <% end %>
- # The html of the remove button
- <a class="remove_nested_fields" data-association="loan_securities" href="javascript:void(0)">Delete</a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement