Hemant Darpal
Hemant Darpal

Reputation: 21

handle Link_to_remote in rails 5

I want to move from rails 2 to 5 but link_to_remote is not supported by Rails 5:

<%= link_to_remote "Add", 
  :url=>{:action=>'fee_submission',:batch=>@batch,s_id=>@stud_id}

In controller:

def fee_submission
  # ..some code..
  render :update do |page|
  page.replace_html "fee", :partial => "fees"
end

View _fees.html.erb:

<html>
  code
</html>

How can the above code be implemented in Rails 5?

Upvotes: 0

Views: 1214

Answers (1)

widjajayd
widjajayd

Reputation: 6253

probably you can use remote: true in parameters option from link_to here is link for more detail

<%= link_to "Add", fee_submission_controller_path, remote: true %>

Upvotes: 1

Related Questions