logo
down
shadow

button_to path routing in Rails


button_to path routing in Rails

By : Alex Shao
Date : November 17 2020, 11:58 AM
it should still fix some issue I'm not sure if this will completely solve your problem, but... You can custom define a path like so:
in config/routes.rb
code :
delete 'destroy/:id', to: 'users#admin_destroy', as: :destroy


Share : facebook icon twitter icon
Rails button_to fails with path doesn't exist for a path that exists

Rails button_to fails with path doesn't exist for a path that exists


By : user2809698
Date : March 29 2020, 07:55 AM
wish helps you button_to defaults to the post method. Try putting :method => :get in there. This is why link_to works.
Ruby on Rails: button_to uses absolute path, but I need relative

Ruby on Rails: button_to uses absolute path, but I need relative


By : gowarrior
Date : March 29 2020, 07:55 AM
around this issue Use
mail_in_payment_new_org_contact_student_application_app_fee_payment_path
Routing error on rails button_to method

Routing error on rails button_to method


By : Gustavo Adolfo Núñez
Date : March 29 2020, 07:55 AM
I hope this helps . Trying to create a button_to that updates a single attribute, but I'm getting routing errors. Here's the code: , So, simple mistake. It wanted an :id element, obviously.
Making rails button_to link to a path with a parameter

Making rails button_to link to a path with a parameter


By : Oleg Starodubov
Date : March 29 2020, 07:55 AM
rails button_to current_user correct path

rails button_to current_user correct path


By : Beaulah Jansi
Date : March 29 2020, 07:55 AM
will be helpful for those in need I think you want one product controller index action and association between user and products
Then in products#index action
code :
def index
  @products = current_user.products
end
= link_to 'View My Products', {controller: :products, action: :index}
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org