search for: before_actions

Displaying 17 results from an estimated 17 matches for "before_actions".

Did you mean: before_action
2013 Oct 18
3
before_action - performing an action to prevent
class WebsocketController < WebsocketRails::BaseController private def authenticate? unless current_user.token == message[:token] current_redirect_to ''home/index'' false # that here we need to do to stop the further execution? end end end class WorldsController < WebsocketController before_action :authenticate? def index
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?''
2005 Dec 01
0
symlink and 0.14.3
Hi! I have a little problem with 0.14.3. I followed the http://wiki.rubyonrails.com/rails/pages/HowtoUseSymLinksToGraftRailsOntoYourWebsite but it''s not work. My rails directory is /home/boci/ujautoszalon and I symlinked the public dir to /home/httpd/htdocs/ujautoszalon2, but it''s not find the database.yml file. Here is the whole log:
2008 Mar 08
7
ridding away with do_request
I''m heading out of town, but had a quick thought I wanted to share. Rather then using ambiguous named request helpers in controller specs like "do_request", I''ve been using more readable helpers like "post_create". For example... describe ProjectController do def post_create post :create, ... end before do end it "creates a new
2007 Apr 09
2
Errno::EACCES in Controller / Permission denied
Hello, I did a seemingly smooth install of ferret, but when I try to add it to my model, I get an error. My info: My rails site: shelikes (a restaurant review site) My controller: Display My model: Review My only line of code added for ferret is: class Review < ActiveRecord::Base acts_as_ferret ...( more stuff not related )... end Below is the error information. Any thoughts on how
2014 Mar 26
0
Heroku | Rails 4 | Ruby 2.0 - send_file not presenting file for download in the browser
Hello all, I am have an app that is hosted on heroku (rails 4 | ruby 2.0) that I am using paperclip-dropbox to upload attachments to a blog. I have created a download link for people who read the blog to be able to download the attachments but I am not able to get the file to actually download via the browser. I am curious if anyone knows what could be the issue. My process is I download the
2014 May 19
0
Can ActiveRecord::Base.connection.schema_search_path be set per process?
I am building an app that every company has it own private schema(Postgresql). For every requisition, I set the Postgres search path in a before_action like this: ActiveRecord::Base.connection.schema_search_path = 'company_id, public' If I have multiple Unicorn workers, and one worker 'A' set the path, while another work 'B' set the path before worker A has finish, I
2006 Apr 08
2
respond_to causes DoubleRenderError?
I have a custom authentication plugin that redirects users to a login site if they aren''t already authenticated and their session hasn''t timed out. I had things working fine with straight http requests, but wanted to add support for ajax requests. I thought this would be a simple matter of replacing all of my "redirect_to <blah> and return false" calls with
2006 Apr 21
5
installing hieraki help
Ahoy, I tried to install hieraki and it was a big mess. 1) upload_progress module needed to be installed 2) no test/development server configured in the config file so i had to add those 3) no log directory, had to add that 4) had to install 2 gems (ok fine) 5) once the server started, go to homepage and " NameError in Wiki/pageController#index uninitialized constant Node RAILS_ROOT:
2006 Jul 27
9
CalendarHelper
Has anyone had any luck using the CalendarHelper plugin at http://wiki.rubyonrails.com/rails/pages/CalendarHelper recently? I''m scratching my head over the following error when I look at any page in my application: NameError in CalendarController#index undefined local variable or method `date_format'' for #<CalendarController:0x24ccd4c> RAILS_ROOT:
2005 Nov 16
4
What happened to mysql connection?
I''ve been using Rails for more than six months and until today I had no problem with mysql connection. It''s a Mac OS X 10.4 box having rails installed and updated by gem. I use a remote mysql server no local instance installed. Here''s my config: development: adapter: mysql database: hdchat host: 10.0.0.1 username: webuser password: test: adapter:
2006 Aug 02
0
Errno::ENXIO (Device not configured) when using net/https from rails
Cross posting this to the rails list in case it might be rails specific. I really have no clue on this one. OS is Freebsd 6.1. I have the following code that creates a https connection from within a rails controller. Works fine except that if it doesn''t get called for a few hours it starts throwing an exception until I restart rails (apache1.3 + scgi). I wonder if something here
2008 Jan 30
3
Order of the get call and xxx.should
Just out of curiosity, why is that the following .should calls have to differ to work? The first is a normal check on the if the user is redirected if not logged in ========= it "should redirect the user to the login screen" do do_get response.should redirect_to(new_session_url) end The second is checking to ensure that the proper user validation method is called ========= it
2006 Mar 28
12
cached-model broken with Rails 1.1
It looks like cached-model is broken again under rails 1.1. Can anyone confirm? Note that the exception below indicates it''s trying to treat CachedModel as the class name of the model, rather than using the proper class name (which is Entry in this case, and the table called entries). This is a model using Single Table Inheritance and acts_as_tree, and worked just fine under 1.0 and
2013 Jul 08
4
Devise routes
hi... i am using two devises in rails 4 application,i need the routes for those devises. rails 4 is new feature for routes -- Posted via http://www.ruby-forum.com/. -- 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
2006 Jan 09
7
File_column Dynamic directory
I asked this question earlier and did recieve an answer but I am not sure Ifully understood the answer as I am getting all sorts of errors when trying to implement. Basically I want to add a layer to the path for my files. I have the following set up in my model class: file_column :image, :store_dir => :dynamic_dir def dynamic_dir
2006 Mar 13
16
Lost connection to MySQL server during query
I just downloaded and installed Ruby on Rails to a Win XP SP1 OS using XAMPP. I started going through the beginner tutorials at rubyonrails.org. It appears as though Ruby on Rails is operating properly until I try to access the MySQL database I created for it. Then the browser displays a detailed statement created by Ruby. It is titled: ActiveRecord::StatementInvalid in Recipe#New Recipe is