Tuesday, July 9, 2013

[Rails] Hide URL from view

Hi,
I have a button as below.
<%= button_to('On', @userdetail.url + '?value=1', :method => "post", :remote => true, :disable_with => 'loading...') %>   
Here @userdetail.url is a external URL, and I don't want to show the url in view source for users.

How can I create a controller action to do the task and point the button to that controller action? Tried implementing curl in my controller action but couldn't make it work as this button action is a post method.

Any example help will help.
I am also trying to expose the button action as a API. Is there anyway I can expose the same controller action as a API?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8a340fb9-0f5d-4da3-b98d-526a9b5ce0de%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate