0

I am using api_auth to sign my requests. I have a link_to button that makes a get request to a controller (allowing my admins to sign in as any users via Devise).

link_to "Click Here", "https://localhost:3000/sign_in_as_user?admin_user=#{current_user.id}&user_id=#{s.id}", target: "_blank"

I've read through the api_auth doc (https://github.com/mgomes/api_auth) and see how I can generate a signed request in controllers.

However, I want to be able to create a signed_request when I click on the above link_to tag.

How do I successfully sign a link_to get request?

Huy
  • 10,806
  • 13
  • 55
  • 99

1 Answers1

1

You would need to create a helper method, or controller method that creates the signed request. Then you can link to the action that creates the signed request for you.

link_to "Click Here", {:action => :new_action_to_create_signed_request}, :method => :post