Routes and controller question

Hi,

I uploaded my application to the web server and every thing is working
fine besides the admin area I created. The directory’s structure is
that all the pages that are controlled by an admin are inside “admin”
directory. The admin controller basically just looks after the login
and authentication.
It has a method to check for login and redirects the user to the admin
directory and in it to the product controller.

redirect_back_or_default(:controller => ‘/admin/product’)

but what happens is that the login occurs fine but I get a 404 error,
which I don’t get on my local machine, because it works fine on my
computer.

My routes.rb has the following lines:

map.connect ‘:controller/:action/:id.:format’
map.connect ‘:controller/:action/:id’

My rails version is 1.2.3 but I’m not sure of the rails version on the
server (I’m using rails playground hosting).

Maybe the problem is that the routes don’t correctly map so Rails
thinks I want to load {:controller => “admin”, :action => “product”}
even though I really want {:controller => “admin/product”, :action =>
“index”}

Would anyone have asuggestion on how I could fix this?

TIA,
Elle

Remove the / before admin and see if it works then.

On Dec 12, 2007 11:00 AM, elle [email protected] wrote:

My rails version is 1.2.3 but I’m not sure of the rails version on the
Elle


Ryan B.
http://www.frozenplague.net

Still get a 404 error. Same with any other pages I try to access that
in the admin directory.

Elle

restart the production server… then it will work

On Dec 12, 2007 6:05 AM, elle [email protected] wrote:

that all the pages that are controlled by an admin are inside “admin”

“index”}

Would anyone have asuggestion on how I could fix this?

TIA,
Elle


Ryan B.http://www.frozenplague.net


With regards,
Arunkumar B.
9789980534.
http://thinkingrails.blogspot.com

Probably a silly question but still: on my computer I use ctrl+c to
restart mongrel. On the web server, I will need to login using SSH and
then what?

Elle

ps -e | grep ruby

kill

If that doesn’t do it, try kill -9 instead.

On Dec 12, 2007 3:57 PM, elle [email protected] wrote:

On Dec 12, 2007 6:05 AM, elle [email protected] wrote:

On Dec 12, 11:32 am, “Ryan B.” [email protected] wrote:

that all the pages that are controlled by an admin are inside
but what happens is that the login occurs fine but I get a 404
server (I’m using rails playground hosting).
TIA,


Ryan B.
http://www.frozenplague.net

Wouldn’t that kill the first running process, which I guess would be
the web server? but then, do I need to start it?

Elle

it should start itself. I’m assuming you’re running RoR through apache?

On Dec 12, 2007 4:19 PM, elle [email protected] wrote:

then what?

in the admin directory.

I uploaded my application to the web server and every thing is
the

Rails

Elle
Ryan B.http://www.frozenplague.net


Ryan B.
http://www.frozenplague.net

Yes, Apache.
When I run the first command I get:
2202 ? 00:00:04 ruby
2219 ? 00:00:02 ruby
22014 ? 00:00:02 ruby
22807 ? 00:00:07 ruby
23139 ? 00:00:05 ruby

so, my next command should be kill 2202??

Elle

and 2219 and 22014 and 22807 and 23139.

On Dec 12, 2007 4:49 PM, elle [email protected] wrote:

If that doesn’t do it, try kill -9 instead.

I uploaded my application to the web server and every
login

but what happens is that the login occurs fine but I get a

even though I really want {:controller => “admin/product”,
Ryan B.http://www.frozenplague.net
Ryan B.http://www.frozenplague.net


Ryan B.
http://www.frozenplague.net

I get this:
-jailshell kill 2202 Operation not permitted

Elle

Ask your friendly neighborhood network admin to do it for you.

On Dec 12, 2007 5:00 PM, elle [email protected] wrote:

23139 ? 00:00:05 ruby

then what?
access
wrote:

inside

admin
works

version on

even though I really want {:controller =>


Ryan B.http://www.frozenplague.net


Ryan B.http://www.frozenplague.net


Ryan B.
http://www.frozenplague.net

What do you think, should I just eliminate the admin directory so all
the controllers are in the same directory?

Elle

I wanted to ask again in regards to my original problem: where all my
admin pages are in the “admin” directory but the application thinks I
am trying to access admin controller action product instead of going
to the product controller inside the admin directory.

Because it works on my machine but not on the web server, I tried to
freeze gems and uploaded the rails directory that was created in the
vendor one.

I also still have problem with restarting the server. The support team
said to run the following commands:
ps aux | grep username
to see what processes belong to my user and then
killall -9 dispatch.fcgi
but again I get “Operation not permitted”

So, I’m still not sure why it works on my computer and not on the
server. And I still not sure how to fix it.
Would someone please have an idea of what my problem is?

TIA,
Elle

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs