hara acharya
2013-Jul-10 18:15 UTC
Hide URL from View in rails by defining the post action to external URL in controller
I have a button as below. <%= button_to(''On'', @userdetail.url + ''?value=1'', :method => "post", :remote => true, :disable_with => ''loading...'') %> In the button above, @userdetail.url is an external url. But I don''t want to show that external url when somebody does a view source. Is there any way I can achieve it. Writing a controller action will do so, but I am not able to make everything work through controller action. Here''s what I tried. In a controller action how can I define a post method. Should I execute a curl post call to achieve this. Should I try something like this in controller action. def button_action @userdetail = Userdetail.find(params[:id]) curl @userdetail.url + "?value=" + value end and define a route. I tried this but it didn''t work. Any live example to do a post to external URL via controller action and using the same in the button_to will help. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscribe@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at http://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/groups/opt_out.
Steve Klabnik
2013-Jul-10 21:52 UTC
Re: Hide URL from View in rails by defining the post action to external URL in controller
This list is for discussion of features of the framework. For help using it, please post to Stack Overflow or rubyonrails-talk. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscribe@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at http://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/groups/opt_out.