I have traced this down to cucumber not knowing how to follow a javascript 
link. Or that my step definition is not setup correctly to following a 
javascript link.

I decided to test that things were working as they should in the browser 
and they work as expected. So its something with using click_on that isn't 
working right. Maybe there is something else I can use besides click_on 
that is created for javascript.

On Wednesday, February 19, 2014 7:27:05 PM UTC-5, Vell wrote:
>
> Hello all,
>
>  
>
> I am stumped by this issue I am having. I have created a new method in my 
> routes file that I want to have accessible via javascript. Right now, I am 
> getting the following error when I try to access the action:
>
> ActionController::UnknownFormat (ActionController::UnknownFormat
>
> Here is my environment:
>
>  
>
> routes:
>
>   resources :homes do
>     collection do
>       get 'set_active'
>     end
>   end
>
> controller
>
>  
>
>   def set_active
>     @home = Home.find(params[:id])
>     respond_to do |format|
>       format.js
>     end
>   end
>
> index page:
>
> <%= link_to home.status, set_active_homes_path(id: home.id), remote: true %>
>
> If i take out the respond to in the set_active action, it complains of a 
> missing template even though I have a set_active.js file in the 
> views/homes. This leads me to believe the respond_to block is the issue and 
> not the fact that I am sending the JS format from the URL. It looks like 
> this action is only responding to html even though i have put remote: true 
> in the link_to. I am trying to understand what I am missing.
>
>  
>
> I did google around and the only thing I saw was that the js mime-type was 
> not available by default and to add it to the mime-types initializer. But 
> when i did that, rails said that it was already initialized.
>
>  
>
> Am I missing something to be able to add JS/JQuery support?
>
>  
>
> Thanks in advance
>

-- 
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 [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/rubyonrails-talk/6e5cd2d5-055b-4fd5-bd85-d695f816881e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to