On Sun, Feb 26, 2012 at 2:02 PM, Dev Guy <devguy...@gmail.com> wrote:
> Hi I managed to get an ajax form working somewhat, something like the
> one below to be able to set and release a bookmark to a post. What I
> want to know is how can I change the submit button so that it toggles
> between the label, "Pin" and "Un-Pin" ?
>
> <%= form_tag( snipmark_path(@post), :remote => true ) do %>
> <%= submit_tag "Pin" %>
> <% end %>
>
> Right now the controller code get calls to set or release the bookmark
> to the post, but I am getting a error saying Rails can't find my view?
> I don't want to change the view. So along with change the submit
> button label, what do I need to do to make Rails happy about not find
> a view template?

ok I managed to figure out I can use link_to with :remote => true and
then use jQuery to toggle the anchor text

-- 
Kind Regards,
Rajinder Yadav

SafetyNet Test Driven Development
http://safetynet.devmentor.org

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to