similar to: before_filter :action_name OR :action_name

Displaying 20 results from an estimated 6000 matches similar to: "before_filter :action_name OR :action_name"

2006 Jul 02
3
2 before_filters, only want one to render something
I have two before_filters for a few of my controllers. They are running my own methods authorize and admin_authorize. authorize is called on just about every action to make sure that a user is logged in. admin_authorize is called on about 80% of the actions and is used to make sure that a user is an administrator. If a user tries to access an admin_authorize protected action without being
2006 Jul 26
5
Restricting before_filter to certain actions?
Can you restric before_filter to specific actions? -- Posted via http://www.ruby-forum.com/.
2008 May 06
12
Why before_filter is not working?
I have been scratching my head on this one for most of the day. Hopefully someone can help explain why before_filter isn''t working for my codes. In my Application controller, I have this: before_filter :login_required, :except => [:newacct, :create_newacct, :passwd_reset ] def login_required unless session[:user_id] flash[:notice] = "Please log in"
2008 Jun 13
3
before_filter order of execution
Hi I''m trying to use before_filter to allow access to a site. Only logged in users can view any object in the controller, but only users with a access_level higher than 2 can view specific objects. My code is: ----------------------------------------------------------- IN USER_CONTROLLER before_filter :login_required before_filter :access_granted, :only => [:destroy, :new , :edit]
2006 Feb 27
3
Send parameter along with method in before_filter
Hello list, I have an app that has a very simple authorization scheme. A person can have many roles and roles can have many people. In my app, I''d like to do before_filter :login_required (since no role name is provided, it accepts any users with credentials) before_filter :login_required ("administrator") (only accepts those with role administrator) before_filter
2006 Jan 29
3
SHLG and lib dir
Slowly figuring out how to get my SaltedHashLoginGenerator stuff working. The wiki page says to put "before_filter :login_required" in the user (my "user" is "member") controller or in ApplicationController. However, wherever I put it I get NoMethodError. The rest of the SHLG stuff seems to be working... or at least I could get to the signup page, register, and
2006 Feb 27
2
submit_tag
How can i use the submit_tag method (from: actionView::FormTagHelper) to create various submit buttons and chose the right action in accord to the button that i pushed? -- Posted via http://www.ruby-forum.com/.
2010 May 27
3
before_filter always running in test, not in development or production mode.
I''m using Shoulda and restful_authentication on Rails3 and whenever I run my tests a before filter for login_required is always triggered, despite my filter being set up as: before_filter :login_required, :only => [:update, :edit, :suspend, :unsuspend, :destroy, :purge] My test is this: context ''A guest to the site'' do context ''on GET to
2006 Apr 29
11
Multiple actions from one form - possible?
Hello * Obviously the rhtml below does not work, but it should be apparent what I try to achieve - I would like to give the user the choice to submit a form either to action1 or action2 but I cannot figure out how?! It would be great if someone could give some assistance. Thanks a lot, Alex <%= start_form_tag :action1 => ''save'', :action2 =>
2006 May 16
2
before_filter and the application controller
Hi there, I''m having a bit of an issue with my before_filter. I know that the filters put in the application.rb controller are global for all the controllers. In my application filter I''d like to allow access to the RSS feed method in a ''member'' controller and skip the login checks that the before_filters are currently performing. In my application my filters
2006 Apr 03
3
render :partial + redirect_to :controller
This is of course disallowed, which I discovered only after nearly completing my spanking new ajaxified UI. What is the motivation behind this, and what is the best workaround? This UI does a scriptaculous drag-and-drop of items from a first div (div1) over to a second div (div2), which triggers the contents of div2 to be updated to reflect the drop. No prob, thus far. But then the
2006 Apr 22
3
Making a separate admin zone
Hi, im building a little cms and i want to separate the admin zone controllers in a subfolder(controllers/admin) if possible to all be managed by one login module, i just have managed simple 3 or 4 controller apps so any help you can give me will be very apreciated. ;) -- Posted via http://www.ruby-forum.com/.
2006 Apr 17
2
newbie before_filter question
I''ve successfully gotten acts_as_authenticated working. Currently the before_filter line for my admin screen is like this: class AdminController < ApplicationController include AuthenticatedSystem before_filter :login_required Only issue I have now is that anyone logged in can access that screen. I''d like to differentiate between a regular user and
2011 Mar 30
3
Test errors in fuctional test after adding before_filter :login_required to controller
Hello, I added the "before_filter" to my controllers to require a login of the user. Here''s an example of my Unit Controller with the added before_filter: IN THE ATTACHED FILE When executing the tests with rake test, I get different error messages. To show you my errors, I only executed the unit controller test with the following line: ruby -Itest
2006 Apr 10
3
form_remote_tag can only have one submit button?
I setup a form_remote_tag with several submit buttons, all of them share the same name ( ''do_action'' ) and their values differ. eg. button1 named do_action with value ACTION1 button2 named do_action with value ACTION2, etc No matter which button I press the value passed is always the one defined for the first of these buttons ( the correct value associated with the pressed
2008 Jun 21
15
will_paginate generates undefined method paginate
Dear I used to use the will_paginate plugin, and now it is no longer available in the repository. I am using the one in the gem #gem install will_paginate in my controller I have this @careers = Career.paginate :page => params[:page], :per_page => 10 and in the view <%= will_paginate @careers %> I found this way in all the tutorials and the railscasts episode 51. Though I still
2008 Jun 25
2
How to escape from the before_filter for the particular acti
Hi, We use the following code in the ApplicationController. before_filter :login_required Iam aware, this will be called for every action. How to escape for the particular action? Thanks, Ayyanar. A -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2009 Mar 23
2
Select updates database?
I am running on Rails 2.2.2 on Solaris (and also on my mac) against mysql. For some reason, when I use a select in the partial, the database does not get updated with the changed value. I am using checkbox for other fields which works perfectly. I can provide more information if needed, but I would like the field to work as a dropdown instead of a text field. My Model:
2004 Jan 21
2
[Fwd: Re: Comboot Menu]
Thanks for the comment. The next pass for a file format ... ------ FILE BEGINS ----- # Comment lines [menu] item="text to display" status="status line text" action= SUBMENU | INACTIVE | whatever submenu= <number> data="arbitrary string" item="text to display" status="status line text" action= SUBMENU | INACTIVE | RUN | EXIT submenu=
2006 Mar 14
6
How to provide 2 actions to a form?
Hi, I have a form in rhtml. Now I have 2 buttons indside that form. Clicking on the first button action will be ''create'' & on second button action will be ''delete''. How to do this? Thanx Prash -- Posted via http://www.ruby-forum.com/.