similar to: flash, before_filter and redirect_to

Displaying 20 results from an estimated 300 matches similar to: "flash, before_filter and redirect_to"

2006 Mar 21
2
Validation to make sure associations don''t change?
I have a main form representing the model, let''s call that ''Order'', and a partial displaying its'' OrderLines. I use the bulk update methods to initialize model objects directly from form data, leaving validation of business logic to the model. As AR likes to write stuff before i do an explicit save, I wrap the whole update in a manual transaction. This works
2006 Mar 14
5
Best way to use partial rendering in global layout
I have a global layout in application.rhtml and I''d like to render a partial template within it. Currently, I have this: <%= render (:partial => ''side_nav'') %> but it seems to be looking in the controller specific view directory. What is the best way to do handle controller - global partial rendering? Wes -- Posted via http://www.ruby-forum.com/.
2009 Apr 24
4
Undefined method "redirect_to" in before_filter
Code sample: class SomeController < ApplicationController before_filter do |c| add_crumb "Blah", "/blah" #breadcrumbs plugin redirect_to :controller => "foo", :action => "bar" unless c.send (:has_package?) end # Rest of the controller... private def has_package? # A bunch of logic work to check to make sure # somebody''s session contains
2006 Mar 07
6
fcgi dispatcher crashing
I''m trying to set deploy an app on apache2 with the fcgid module, but can''t seem to get anywhere. Things work fine with cgi, but when i switch to fcgi, i''m stuck with a ''503: Service Temporarily Unavailable''. There''s no error being logged anywhere, afaik. Trying to run dispatch.fcgi from the shell doesn''t work either. It bombs out,
2006 Mar 13
7
Wilcard search
Hello, I''m writing a search function for my application, but I am unsure on how to search for all results that contain my search string; here''s what I''ve got: def search @products = Product.find(:all, :conditions => "date_available < now()", :conditions => [ "title ilike ?",
2006 Mar 21
13
"Remembering" link to redirect to after logging in
Hi, Suppose I have a resource such as http://localhost:3000/topsecret/data that requires the user to login first. What I did was make use of before_filter to check and see if the session variable is set with the logged in user''s id (similar to the example in "Agile Web Development with Rails"). However while the filtering function does work correctly in redirecting the
2006 Mar 24
10
innodb vs myisam
Hi, I have been using myisam tables in mysql with rails because my client will soon want fulltext searchable content, however when I migrated my development db from schema.rb all of the tables generated were innodb. I understand that I can override this, but also like the transactions and foreign keys of innodb. So 2 questions really: 1. are transactions in activerecord dependent on innodb or do
2007 Dec 11
0
before_filter work around
Hi All, I am working on a rails app that has facebook and non-facebook portions and since facebooker seems to want to resolve to the default route of "/" i''ve written a little before filter that seems to make these two exist OK. def is_facebook_request? redirect_to(params.merge({ :controller => ''facebook_accounts'' })) and return false if
2006 Aug 03
1
strange before_filter error. is this a bug i have found?
... before_filter :find_regression_test def find_regression_test @regression_test=RegressionTest.find(8) end .... The above seems like perfectly normal before_filter syntax, but it gives this error. Aldo is no application trace, just a framework trace: Any idea what is wrong? NoMethodError in Regression testsController#modify_regression_test private method `equal?''
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/.
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
2006 Mar 10
3
before_filter question
Let''s say I''m using before_filter in my controller: before_filter :setup def setup # do something here end Is there any way my setup method can know which action is really about to be called? Let''s say I want to log out which action is going to be called, how can I know that in the before_filter method? (My question is not really about logging,
2008 Mar 16
0
bypassing verify_authenticity_token before_filter when in facebook
Hi list, Not sure if this is helpful for anyone but I am working on a Facebook project where I need bypass the new CSRF protection (built into Rails 2.0) under certain conditions. However, since my project works outside of Facebook I don?t want to disable the CSRF protection from requests made outside of Facebook. Here is a small extension i wrote for the ForgeryProtection module.
2006 Feb 20
1
Using :except or :only on a before_filter block
Hi all, How do you use :except or :only conditions on a filter block? I can''t seem to work out the syntax! I''m currently doing: before_filter { |c| c.role_required ''admin'' } Thanks a lot! Tom
2005 Dec 15
2
Passing parameters to before_filter methods
I have a method that checks for a given role. I want to write something in my controllers like before_filter :check_roles(''admin'') Which will ensure the current user has the admin role. Is it possible to pass parameters in this way? Ian
2007 Jan 13
0
before_filter not executed in functional tests
Hi, I have a before_filter ''authorize'' defined in the application controller that checks for a user in the session. However, when I test a controller (that has before_filter ''authorize'') like this: def test_new_without_login get :new assert_redirected_to new_session_path end the fails because the response is ''success'' instead. When I set
2006 Nov 21
2
before_filter in actionwebservice controller using direct dispatching
The docs say that for direct dispatching mode to use controller filters, but when the controller is run I get the following error. The authorize method is in application.rb. Works fine when it''s not a web service api. Should I be using before_invocation instead even with direct dispatching mode? Or can I not have the authorize method in application.rb? undefined method
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:
2008 Oct 25
1
Returning a variable to before_filter
I know its probably doesnt sound right, but I am trying to call a before_filter method that will check whats the user role and then based on that return a string / hash / array to the before_filter something like this: class MonqiClassesController < ResourceController::Base before_filter :check_user_access_level , grant_access def check_user_access_level if
2006 Aug 23
0
Caches_action/ before_filter problem .
Hello, I have a method called "check_permission" that is set to run as a before_fitler and which checks if a user has the authorization to view a page. This page is displayed through the method "show" which is cached through the tag "caches_action :show" My problem is that once a user with authorization to a page accesses it, then afterwards all users (with or