I’m not a jQuery expert but that doesn’t look like it will work, the form is 
already firing at this point so even if you have the right form, with the right 
attributes (you haven’t pasted your generated view so it’s impossible to tell) 
you possibly can’t mutate it. I *think* you need to change the action, submit 
the form yourself, and then return false from the original JS event.

Jon Rowe
---------------------------
[email protected]
jonrowe.co.uk


On Wednesday, 17 December 2014 at 09:02, John wrote:

> This is my javascript code   
>  
> $('input[data-action]').click(function() {
>     $('form#searchform').attr('action', $(this).data('action'));
>   });
>  
> On Tuesday, 16 December 2014 22:23:31 UTC+1, John wrote:
> >  
> > Overview :
> >  
> >  
> > in my views i have a button(test) with action image.csv , when i am 
> > clicking( find_button('test').click) on that , it sending to controller 
> > image
> >  
> >  
> > Problem :  
> > It's not passing whole action to the server . so format option always 
> > getting html , not csv , in the test cases
> >  
> >  
> > please suggest me for the same
> >  
> >  
>  
>  
>  
> --  
> You received this message because you are subscribed to the Google Groups 
> "rspec" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> (mailto:[email protected]).
> To post to this group, send email to [email protected] 
> (mailto:[email protected]).
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rspec/63732d1f-4c17-4532-ad3b-8d1512bcba52%40googlegroups.com
>  
> (https://groups.google.com/d/msgid/rspec/63732d1f-4c17-4532-ad3b-8d1512bcba52%40googlegroups.com?utm_medium=email&utm_source=footer).
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rspec/8729464F52ED460A95B7868A1405A183%40jonrowe.co.uk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to