-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
overriding actions(search,show,edit,delete,new) #518
Comments
What about a filter? before_action :allow_search private def allow_search
|
Hi naaano, The solution you gave is perfect for what I have asked for. But it's not serving my purpose. I want to call that function whenever I send the request to the server. Can I do that? Because when I added the code you suggested, the request is being denied with 307 status before the filter is called. Thanks. |
I want to make a dummy request something like this in my code. But not sure where to add this(in which file). Can someone help me with this? |
I don't really understand you, 307 status code is not denied, it's redirect status code. I don't know why you get that without seeing your code. And I don't understand what you want to do. What is that dummy request? What does it relate to show_search? If you want to add a link to make request to some action, you can add action_link: config.action_links.add :action, type: :member Use type: :member for adding link for each record, use type: :collection for adding link in table links, next to show search and create links. |
Hi,
I want to call a function
logged_in?
whenever an action is performed.Is it possible by overriding the corresponding methods?
For ex: show_search is being called when I click on search.
So if I define show_search as below in application_controller.rb, will it serve my purpose?
I tried doing that, but ended up with the following error:
Can someone let me know how to proceed?
Thanks.
The text was updated successfully, but these errors were encountered: