Displaying 20 results from an estimated 10000 matches similar to: "Problem with routes"
2010 Jul 08
1
[Rails3] Issue in modifying locale and redisplaying page
In a test app, I have a drop-down selection to change the language of
the site.
I use an Ajax request to an action in which the locale is changed, and
the it''s redirected to the home page
unfortunately, the locale seems to be changed but the home page
doesn''t reflect the new language ..
application_controller.rb
.. before_filter :set_locale
def set_locale
I18n.locale =
2006 May 03
1
Globalize app example anywhere?
Hi!
Is there anywhere tutorial how to create working application using
globalize plugin?
I need to create a site in 3 different languages and i was suggested to
use globalize plugin. I''ve read a bit on globalize wiki page and pdf
from the presentation available on the same page, but i still can''t
figure out how to use it.
1. Can i translate names of models and columns
2007 Jul 31
0
Edit not working with named routes
HELP! I''m a relatively new rails user and I''m stuck. I''m trying to
build a relatively simple blog and I decided that I liked the way
named routes look in the code. So I added
map.resources :posts
to my routes.db file. I then went through and updated my controller to
take advantage of the named routes that were generated. I also updated
all of my views and everything
2006 Aug 14
1
Rest, routes, path_prefix and default params
I am trying to use routes with default params to have routes
''/mycompany/departments''
and
''/companies/1/departments''
mean the same thing (both restful routes).
When I set up the files as below, I get an error of
''Couldn''t find Company without an ID''
and my log file shows the following ..
Processing DepartmentsController#index (for
2006 Dec 11
0
auth_generator 2.0.1 undefined method `login_required' for ... ArticlesController
I am a relative RubNub and attempting to implement auth_generator v.2.0.1.
I am getting an "undefined method `login_required'' for
#<ArticlesController:0xb732c0b4>" error when I attempt...
http://localhost:3000/articles/new
Help would be appreciated.
My app/controllers/application.rb reads...
------------------------------------------------------------------------
2010 Apr 26
2
woriking under webrick but not under passenger
Hi!
I have just added login feature to my rails application (followed the
instruction from (Agile Web Development with Rails) but now I am getting
strange errors (looks to me like some kind of routing problem) under the
passenger/apache.
The error is:
500 Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
From the log:
2009 May 15
0
[PATCH server] final cleanup for service layer refactoring.
I've pulled out the no-longer-necessary remnants of the old way of handling auth and before_filters as well as fixing a couple bugs that had crept in along the way.
Unit test fixes for the refactoring will follow in a subsequent patch.
Signed-off-by: Scott Seago <sseago at redhat.com>
---
src/app/controllers/application.rb | 46 ----------------
2011 May 09
0
rails guides - getting started - section 10 security
The example doesn''t work as described for me; not sure if I haven''t
followed it right, or there''s a problem with the code. Can someone
help me to determine what the problem is.
Specifically, after adding the authentication code to the
PostsController, with this line:
before_filter :authenticate, :except => [:index, :show]
The guide says that "we want the user
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
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
2007 Aug 15
4
nuby: how spec redirect_to at ApplicationController
Good morning rspec people!
Still rspec nuby: I must do something wrong obviously.
How can I spec about redirect_to at ApplicationController
describe ApplicationController do
it "method login_required should redirect to home path without login" do
pending "I tried to use controller.login_required.should be_redirected
and got NoMethodError with nil object
2013 Mar 20
2
Rspec + Devise + BaseController
Hello there,
I''m creating a base controller for the admin section of a project. All
controllers whitin the admin section will inherit from it.
#####################################################
#app/controllers/admins/base_controller.rb
class Admins::BaseController < ApplicationController
layout "admin_cms"
before_filter :authenticate_admin!
end
2008 Jul 29
0
handling multiple lookup tables in rails
I''ve got an application that will have a handful of lookup tables. To
be clear by this I mean tables that only have two attributes, id, name
and are used to provide drop-down lists for other tables/forms so that
these fields have "standard" values. I need 5 to 10 of these tables.
I''m a ruby/rails neophyte but I''ve read Agile Web Devel with
Rails, Rails
2008 Nov 05
3
Problems w/ before_filter getting ignored
Hello,
I''m setting up an authentication module that will be called from
application.rb. I want to save a rrequest.request_uri into a
session to be used as a place holder that
will take users back to the page they were on before they logged in.
I''m trying to call the store_location method for all methods EXCEPT
login by putting login in an except before filter.
For some
2011 Nov 12
4
No route matches [GET] "/microposts/304"
Hi all,
I''m learning Rails by Example (chapter 11), by Michael Hartl (
http://ruby.railstutorial.org/chapters/user-microposts#top) but I got no
route matches when I try to delete one micropost.
the _micropost html is...
<tr>
<td class="micropost">
<span class="content"><%= micropost.content %></span>
<span
2006 May 04
0
Using ActiveRBAC 0.3.1 to restrict entire site?
All,
I''m trying Active_rbac for the first time.
I have the basics working so I can protect a single controller.
I want to protect all of my controllers so users have to login to see anything.
I''m trying to put a before_filter in my application controller, but I
don''t know how to do the except correctly. I''ve been trying this:
class ApplicationController
2007 Sep 30
9
Problems with testing nested routes using mocking
Hello forum
I have there to files
#----- virtual_host_controller.rb
class VirtualHostsController < ApplicationController
before_filter :capture_domain
# GET /domain/1/virtual_hosts/1
def show
@virtual_host = @domain.virtual_hosts.find(params[:id])
respond_to do |format|
format.html # show.rhtml
end
end
private
def capture_domain
if
2006 Apr 23
2
Check if current route == some route
I have a before_filter in ApplicationController in which I want to check
if the current location is the same as a certain route, so that I only
redirect non-logged in visitors to the "join" page if they''re not on
that page already.
The code I came up with is a bit ugly:
redirect_to join_url unless (@logged_in or action_name == "join")
I''m pretty sure
2006 Dec 01
0
You are being redirected message
Ticket #3082 details a fix to add a body to redirect pages. This seems like
an old patch, but only now is it biting me. I have an authentication scheme
like this:
class ApplicationController < ActionController::Base
before_filter :check_authentication, :except => [:signin]
def check_authentication
return true if session[:user]
session[:return_to] = request.request_uri if
2012 Apr 02
0
uninitialized constant UserController
Rails 3.1.3
I am trying to create an administrator page. ''User'' table has a field,
admin:boolean, then user having ''admin=true'' can only access it, as you
can imagine.
But accessing
http://localhost:3000/admin/user
gives an error,
uninitialized constant UserController
I have ''controllers/admin/admin_application_controller.rb''
class