i try to use Ajax in my application with Rails 4. To send my js to the client i use :
respond_to do |format|
format.js
end
If you can use link_to
helper function to call action of your controller, in your case Oweb::MainController#setmagasinstatus
adding :remote => true
to link_to
helper will solve the issue.
For example if you have a link to your action and want to get response in ajax the following code will create the link to that action:
<%= link_to your_link_name, setmagasinstatus_path(:params), :remote => true %>
Here is a dead easy sample https://coderwall.com/p/kqb3xq/rails-4-how-to-partials-ajax-dead-easy