Displaying 17 results from an estimated 17 matches for "before_action".
2013 Oct 18
3
before_action - performing an action to prevent
...tRails::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
current_html_insert ''worlds/index''
end
end
From the documentation: If you call *render*, *head* or *redirect_to* from
a *before_action*, the filter chain will be halted, but I have a different
situation:
current_redirect_to and current_html_in...
2006 Aug 03
1
strange before_filter error. is this a bug i have found?
.../gems/actionpack-1.12.1/lib/action_controller/filters.rb:411:in
`call_filters''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:394:in
`call_filters''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:383:in
`before_action''
......
Thanks
Chris
--
Posted via http://www.ruby-forum.com/.
2005 Dec 01
0
symlink and 0.14.3
...gems/1.8/gems/actionpack-1.11.0.2969/lib/action_controller/filters.rb:350:in `each''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.0.2969/lib/action_controller/filters.rb:350:in `call_filters''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.0.2969/lib/action_controller/filters.rb:339:in `before_action''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.0.2969/lib/action_controller/filters.rb:331:in `perform_action_without_benchmark''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.0.2969/lib/action_controller/benchmarking.rb:69:in `perform_action_without_rescue''
/usr/lib/ruby/gems...
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
...by/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:394:in
`each''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:394:in
`call_filters''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:383:in
`before_action''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:365:in
`perform_action_without_benchmark''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in
`perform_action_without_rescue''
/usr/local/lib/r...
2014 Mar 26
0
Heroku | Rails 4 | Ruby 2.0 - send_file not presenting file for download in the browser
...e user to download. Getting the file to download is working without issue. But getting the browser to present the file is my problem.
I am looking for any help on what I could do to figure out what I may be doing incorrectly.
Here is what I currently have:
app/controllers/blog_attachments.rb
before_action :set_blog_attachment, only: [:download]
def download
download_file(@blog_attachment)
send_file("#{Rails.root}/public/blog_attachments/#{@blog_attachment.document_file_name}",
filename: @blog_attachment.document_file_name,
type: @blog_attachment.docu...
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 think it will
generate some conflict and 'A'...
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
.../gems/actionpack-1.12.3/lib/action_controller/filters.rb:399:in
`call_filters''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/filters.rb:394:in
`call_filters''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/filters.rb:383:in
`before_action''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/filters.rb:365:in
`perform_action_without_benchmark''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/benchmarking.rb:69:in
`perform_action_without_rescue''
/usr/local/lib...
2005 Nov 16
4
What happened to mysql connection?
...s/1.8/gems/actionpack-1.11.0/lib/
action_controller/filters.rb:350:in `each''
/opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/
action_controller/filters.rb:350:in `call_filters''
/opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/
action_controller/filters.rb:339:in `before_action''
/opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/
action_controller/filters.rb:331:in `perform_action_without_benchmark''
/opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/
action_controller/benchmarking.rb:69:in `perform_action_without_rescue''
/opt/local/l...
2006 Aug 02
0
Errno::ENXIO (Device not configured) when using net/https from rails
...ms/actionpack-1.12.3/lib/action_controller/filters.rb:399:in
`call_filters''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/filters.rb:394:in
`call_filters''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/filters.rb:383:in
`before_action''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/filters.rb:365:in
`perform_action_without_benchmark''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/benchmarking.rb:69:in
`perform_action_without_rescue''
/usr/lo...
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
.../gems/actionpack-1.12.0/lib/action_controller/filters.rb:386:in
`call_filters''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/filters.rb:381:in
`call_filters''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/filters.rb:370:in
`before_action''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/filters.rb:352:in
`perform_action_without_benchmark''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.0/lib/action_controller/benchmarking.rb:69:in
`perform_action_without_rescue''
/usr/local/lib...
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