Routing ... Mapping... can only get to index

I have used scaffold to create several controlers… each controller
has 3 to 5 views/actions?

I am thinking I should be able to call on each view by simply putting
the url call in the browser address right?

http://localhost:3000/user_loggin/user_home

But that doesn’t work

Now I have erased index from public and I have my route map.root set to
the right controler and index.

and I have used map.resources on all controllers, which I had to write
manually.

the problem is I can only get to the index of each controller. I can’t
get to the view of any of the aditional actions.

class UserLogginController < ApplicationController
def login
if request.post?
user = User.authenticate(param[:full_name],params[:password])
if user
session[:user_id]= user.id
rediret_to(:action => “user_home”)
else
flash.now[:notice] = “Invalid User name or Passord”
end
end
end

def logout
end

def user_home
end

def index
end
end
when I try it gives me this error:
Unknown action
No action responded to show. Actions: current_search, index, login,
logout, new_search, and user_home

Now it see’s all the other views…the “Action: current_search, index,
login, logout, new_search, and user_home” is listing the views… but I
can’t get them to display

ok so the first problem was I had

map.resources :user_loggin

which is a RESTful type routing???
and it messes with URL routing or some thing …
Deleted it from routes file and can navigate manually threw views…

… wierd

Cameron V. wrote:

ok so the first problem was I had

map.resources :user_loggin

which is a RESTful type routing???

That’s normally what you want. Use RESTful routes unless there’s a good
reason not to n

and it messes with URL routing or some thing …

No, it’s just a shorthand for defining certain routes. Read the docs
for details.

Deleted it from routes file and can navigate manually threw views…

Particularly since you seem to be a beginner, I’d advise starting with
RESTful routes and naming your controller actions accordingly. Judging
from your earlier post, your controller actions have strange names.
Change them to use RESTful style as much as possible.

(Oh, and you misspelled “login”…)

… wierd

Not weird at all. Read the Rails routing guide and docs.

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Sent from my iPhone

Marnen Laibow-Koser wrote:

Cameron V. wrote:

ok so the first problem was I had

map.resources :user_loggin

which is a RESTful type routing???

That’s normally what you want. Use RESTful routes unless there’s a good
reason not to n
Heres a good reason …they wern’t working

and it messes with URL routing or some thing …

No, it’s just a shorthand for defining certain routes. Read the docs
for details.

I read the docs for 3 hours and 2 diferent reference books… not one
told me that adding a map.resource :(controller) to routes would make it
so you couldn’t use the URL to navigate.

Why would I use restful if I have no clue how to use restful?

Deleted it from routes file and can navigate manually threw views…

Particularly since you seem to be a beginner, I’d advise starting with
Way to call out the obvous , what a nice thing to do

RESTful routes and naming your controller actions accordingly. Judging
from your earlier post, your controller actions have strange names.
Who asked for your opinion on naming conventions?

Change them to use RESTful style as much as possible.
Telling some one to change them to restful style; when its apparent
they don’t know what restful is, isn’t saying any thing at all.

(Oh, and you misspelled “login”…)
No I spelt user_loggin exactly the way I wanted to, but you just had
to point it out yes?

… wierd

Not weird at all. Read the Rails routing guide and docs.

I really don’t understand why you responded to my post at all, you
never have any thing positive to say on any of your forum replies and
you constantly interject your own opinion on matters that were never
asked to be addressed.
And it seems to me that you rarley provide any one with any actual
useful information… Go read the manual??? Go read the book!? who
needs that type of advice?..

For example earlyer this week I asked about downloading
rest_authentication becuase I could not get the process to work … did
you reply with some useful help on how to grab plugins on a windows OS?
No! you told me don’t bother with restful_authentication it sucks…and
windows sucks… which whether correct or not has nothing to do with how
to properly down load restful_aunthentication on a windows xp platform.
And thats what I asked for help with if I can’t figure out how to
download restful_authentication, you think I can just go and magicly
download what ever alternitive plugin you suggested.

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Sent from my iPhone

Look dude …no one helped me with this problem…I did figure it out on
my own, by googling and reading and googling and reading … books and
doc’s and I replied to my own question incase some one else accidently
messed with the routing file like I did.

All your response was, was a snobish trashing of my question and my own
response… do me a favor …ignore my questions…

thanks

On Mon, Sep 20, 2010 at 4:51 PM, Cameron V. [email protected]
wrote:

I read the docs for 3 hours and 2 diferent reference books… not one
told me that adding a map.resource :(controller) to routes would make it
so you couldn’t use the URL to navigate.

Docs don’t usually tell you what you can’t do with a resource, they
usually just explain what you CAN do with a resource. shrug

Why would I use restful if I have no clue how to use restful?

I would use restful routes simply because they are the default. In
Rails3 you must either choose to use REST or plan to write a ton of
(work-around) code in routes.rb. Why fight it? REST works great.
Wrap your head around what :member and :collection are for and you got
99% of it down.


Greg D.
destiney.com | gregdonald.com

Greg D. wrote:

On Mon, Sep 20, 2010 at 4:51 PM, Cameron V. [email protected]
wrote:

I read the docs for 3 hours and 2 diferent reference books… not one
told me that adding a map.resource :(controller) to routes would make it
so you couldn’t use the URL to navigate.

Docs don’t usually tell you what you can’t do with a resource, they
usually just explain what you CAN do with a resource. shrug

Why would I use restful if I have no clue how to use restful?

I would use restful routes simply because they are the default. In
Rails3 you must either choose to use REST or plan to write a ton of
(work-around) code in routes.rb. Why fight it? REST works great.
Wrap your head around what :member and :collection are for and you got
99% of it down.


I was taught ruby on rails about a year and a half ago I think it was
ruby 2 …
I’ve been programming in C# for the last 8 months and it pretty much
turned any thing I knew about ruby on Rails to mush
Greg D.
destiney.com | gregdonald.com

Cameron V. wrote:

Marnen Laibow-Koser wrote:

Cameron V. wrote:

ok so the first problem was I had

map.resources :user_loggin

which is a RESTful type routing???

That’s normally what you want. Use RESTful routes unless there’s a good
reason not to n
Heres a good reason …they wern’t working

Not a good reason. If you’re going to learn to use Rails, learn to
use it, not kludge around it. Rails’ routing is a bit complex, but
well worth learning how to use.

and it messes with URL routing or some thing …

No, it’s just a shorthand for defining certain routes. Read the docs
for details.

I read the docs for 3 hours and 2 diferent reference books… not one
told me that adding a map.resource :(controller) to routes would make it
so you couldn’t use the URL to navigate.

Because that isn’t the case as such. You have to understand routing a
little better, I’d say.

Why would I use restful if I have no clue how to use restful?

Because you want to learn, maybe? If you don’t want to learn, why are
you asking questions?

Deleted it from routes file and can navigate manually threw views…

Particularly since you seem to be a beginner, I’d advise starting with
Way to call out the obvous , what a nice thing to do

I wanted to check, not assume. Sorry for trying to be nice.

RESTful routes and naming your controller actions accordingly. Judging
from your earlier post, your controller actions have strange names.
Who asked for your opinion on naming conventions?

Routing is about naming conventions. If you don’t want advice, don’t
ask for it.

Change them to use RESTful style as much as possible.
Telling some one to change them to restful style; when its apparent
they don’t know what restful is, isn’t saying any thing at all.

It was not clear to me that you didn’t know. Anyway, this is a perfect
opportunity to ask more questions or do independent research. It is not
a perfect opportunity to insult those who are trying to help.

(Oh, and you misspelled “login”…)
No I spelt user_loggin exactly the way I wanted to, but you just had
to point it out yes?

I thought you might not want spelling errors in your code. Silly me.

… wierd

Not weird at all. Read the Rails routing guide and docs.

I really don’t understand why you responded to my post at all,

Because I saw you going down the wrong path and I thought I could help.

Now ask yourself: I gave you some advice that was apparently not clear
to you. Why did you bother to respond at all if it was just to
complain that I didn’t spell everything out for you? Do you really
think people on this list will want to help you out if you come here
with that kind of attitude?

you
never have any thing positive to say on any of your forum replies and
you constantly interject your own opinion on matters that were never
asked to be addressed.

I give answers and point out problems as I see them. That’s what a
forum like this is for.

And it seems to me that you rarley provide any one with any actual
useful information…Go read the manual??? Go read the book!? who
needs that type of advice?..

People who don’t read the manual before posting. And on the evidence,
there are lots of them. :slight_smile:

For example earlyer this week I asked about downloading
rest_authentication becuase I could not get the process to work … did
you reply with some useful help on how to grab plugins on a windows OS?
No! you told me don’t bother with restful_authentication it sucks…and
windows sucks… which whether correct or not has nothing to do with how
to properly down load restful_aunthentication on a windows xp platform.

I told you you were making bad decisions, because you were. I also told
you how to fix the problem you were having. If you chose to ignore my
solution, don’t blame me.

And thats what I asked for help with if I can’t figure out how to
download restful_authentication, you think I can just go and magicly
download what ever alternitive plugin you suggested.

Because you can! The Rails plugin installation process is uniform. If
you can install one plugin, you can install them all.

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Sent from my iPhone

Look dude …no one helped me with this problem…I did figure it out on
my own, by googling and reading and googling and reading … books and
doc’s and I replied to my own question incase some one else accidently
messed with the routing file like I did.

All your response was, was a snobish trashing of my question and my own
response…

I wasn’t trashing anything. I was trying to explain how to do things
better. I assumed that since you were trying to learn Rails, you
actually wanted to learn to do things right. Was I mistaken? Did you
just want your ego stroked? Or something else? I really don’t get it.

do me a favor …ignore my questions…

That wouldn’t be doing you a favor. But I might do it anyway if you
don’t lose that attitude.

thanks

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Sent from my iPhone

On Mon, Sep 20, 2010 at 7:40 PM, Cameron V. [email protected]
wrote:

If I followed your advice I would have simple thrown my computer out a
window and spent the next 2 years trying to learn some totally Alein
crap.

YOUR NOT A HELP!

Looks like Marnen made another new friend.


Greg D.
destiney.com | gregdonald.com

Cameron V. wrote:

You don’t get it.

Sorry dude, but you are the one who doesn’t get it. Your posts
‘smelled’ a great deal like a total newbie post, and as such elicited a
response directed at a total newbie.

It may not have occurred to you that your spelling of user_loggin didn’t
strike Marnen (or I) as a “Say, he’s a right smart bloke, and I bet he’s
not spelling the word correctly on purpose.” type of posting… Right
or wrong, there are tons and tons of ESL posts on this board that
probably colored the response to your post. My initial thought was “Oh
crap, another person trying to code php in Rails…”

Your subsequent comment that “and it messes with URL routing or some
thing …” in your second post also sent up red flags for me that 'Why
this bloke seems to have no clue what he’s talking about."

From your fourth post: “Why would I use restful if I have no clue how
to use restful?”

Umm… perhaps because long-time readers and posters on the forum assume
that you come to this forum to learn from people who have already
traveled the road you seem to be on… perhaps because restful routes
is a big thing in Rails, which happens to prefer convention over
configuration, and you seem to be thinking configuration, so perhaps a
redirect was in order…

A great place for information is api.rubyonrails.org; another great
place is your own machine in the console window, and your development
log. Look in the dev log to see what the parameters are that your app
is receiving. Read the api (particularly the routing part) to better
understand that piece. When you used scaffold, did you just scaffold
the full deal (something like: script/generate scaffold person
last_name:string first_name:string ). That’ll generate the controller,
model, views, routing - rake that migration then play with that basic
app - read through the generated code to learn how it all fits - it is
amazingly educational about the Rails conventions. Generally, if it is
hard to do, you’re doing it wrong. Simple as that.

I don’t always agree with Marnen’s opinions, and he does tend to state
things a bit strongly for my taste, but I do always read his posts.
Why? Because he knows more than I, and a hell of a lot more than you.

But as your later posts have indicated, you are not interested in
learning from anyone more knowledgeable than you in Ruby and Rails, you
just want an answer to your ‘user_loggin’ question so you can write the
code your way, however against the conventions of Ruby and/or Rails it
might be.

Ar Chron wrote:

Cameron V. wrote:

You don’t get it.

Sorry dude, but you are the one who doesn’t get it. Your posts
‘smelled’ a great deal like a total newbie post, and as such elicited a
response directed at a total newbie.

Is any of that last rant on topic?

So you want to call me stupid…fine…you think I’m a moron great

Fine I am stupid…I can’t spell very well… maybe all thats true…

You two are great examples of the non tolerant ruby community…

Don’t try ruby if your an outsider…they’ll just call you names and
point out all your programming faults in the ruby community

You know I maybe a moron …but I’ve deployed 12 websites in C# and when
I had a stupid question I posted on a microsoft Forum…I never got
talked down to, lectured or given such rude advice as I just got from u
too…

You don’t get it.

I never asked for any ones advice on naming conventions, proper spelling
, Restful vs url or any of the other usless things you felt compelled to
comment on. I asked why I could not put the url address into the browser
and get the page to return with out an error.

Thats the question
No I did not post my question to get free lectures.
I posted my question hoping some one might know the specific answer.

I posted the code I thought might be relavant to the routing problem
I did not expose it so you can go threw it with a fine tooth comb and
critisize all its failings

and your a lier to boot! the following is your reply to my question of
how to down load a plug in called restful_authentication… No were!
not in one place does it go threw the steps of getting a plugin from the
repository on to my system…You answered nothing! Your awnser about use
install instead of source and be at the root of were your program
is…although correct fixed nothing

If I followed your advice I would have simple thrown my computer out a
window and spent the next 2 years trying to learn some totally Alein
crap.

YOUR NOT A HELP!

Cameron V. wrote:

I’m a fairly new programmer, and I jump back and forth between PHP C#
and Ruby.
I’m trying to install a restful-authentication plugin

Stop trying. restful-authentication is garbage due to its overreliance
on unmaintainable generated code. Use Authlogic or something reasonable
instead. :slight_smile:

but I can’t get it
to install into my ruby directory. I have looked it up and folowed the
tutorials but no luck.

I’ve tried

C:\ruby>script/plugin source
http://svn.techno-weenie.net/projects/plugins/

‘script’ is not recognized as an internal or external command,
operable program or batch file.

Of course it isn’t. The script directory lives inside your Rails app.
You need to be at the root directory of your Rails application to run
that. Your prompt implies that you are not in that directory.

And you just want script/plugin install, not script/plugin source.

[…]

I’m working from windowsXP 64 platform also using Netbeans as my ide.

I would recommend that you drop NetBeans. Rails works best without an
IDE in my opinion. Just use a good editor (I like KomodoEdit, but there
are many others).

I’d also recommend dropping Windows; too much of Rails relies on a *nix
toolset. There are some ready-to-go Rails *nix VMs out there; I’ve been
hearing good things about VirtualRails.

I know it’s simple …but i’m stuck lol

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Marnen Laibow-Koser wrote:

Cameron V. wrote:

Marnen Laibow-Koser wrote:

Cameron V. wrote:

ok so the first problem was I had

map.resources :user_loggin

which is a RESTful type routing???

That’s normally what you want. Use RESTful routes unless there’s a good
reason not to n
Heres a good reason …they wern’t working

Not a good reason. If you’re going to learn to use Rails, learn to
use it, not kludge around it. Rails’ routing is a bit complex, but
well worth learning how to use.

and it messes with URL routing or some thing …

No, it’s just a shorthand for defining certain routes. Read the docs
for details.

I read the docs for 3 hours and 2 diferent reference books… not one
told me that adding a map.resource :(controller) to routes would make it
so you couldn’t use the URL to navigate.

Because that isn’t the case as such. You have to understand routing a
little better, I’d say.

Why would I use restful if I have no clue how to use restful?

Because you want to learn, maybe? If you don’t want to learn, why are
you asking questions?

Deleted it from routes file and can navigate manually threw views…

Particularly since you seem to be a beginner, I’d advise starting with
Way to call out the obvous , what a nice thing to do

I wanted to check, not assume. Sorry for trying to be nice.

RESTful routes and naming your controller actions accordingly. Judging
from your earlier post, your controller actions have strange names.
Who asked for your opinion on naming conventions?

Routing is about naming conventions. If you don’t want advice, don’t
ask for it.

Change them to use RESTful style as much as possible.
Telling some one to change them to restful style; when its apparent
they don’t know what restful is, isn’t saying any thing at all.

It was not clear to me that you didn’t know. Anyway, this is a perfect
opportunity to ask more questions or do independent research. It is not
a perfect opportunity to insult those who are trying to help.

(Oh, and you misspelled “login”…)
No I spelt user_loggin exactly the way I wanted to, but you just had
to point it out yes?

I thought you might not want spelling errors in your code. Silly me.

… wierd

Not weird at all. Read the Rails routing guide and docs.

I really don’t understand why you responded to my post at all,

Because I saw you going down the wrong path and I thought I could help.

Now ask yourself: I gave you some advice that was apparently not clear
to you. Why did you bother to respond at all if it was just to
complain that I didn’t spell everything out for you? Do you really
think people on this list will want to help you out if you come here
with that kind of attitude?

you
never have any thing positive to say on any of your forum replies and
you constantly interject your own opinion on matters that were never
asked to be addressed.

I give answers and point out problems as I see them. That’s what a
forum like this is for.

And it seems to me that you rarley provide any one with any actual
useful information…Go read the manual??? Go read the book!? who
needs that type of advice?..

People who don’t read the manual before posting. And on the evidence,
there are lots of them. :slight_smile:

For example earlyer this week I asked about downloading
rest_authentication becuase I could not get the process to work … did
you reply with some useful help on how to grab plugins on a windows OS?
No! you told me don’t bother with restful_authentication it sucks…and
windows sucks… which whether correct or not has nothing to do with how
to properly down load restful_aunthentication on a windows xp platform.

I told you you were making bad decisions, because you were. I also told
you how to fix the problem you were having. If you chose to ignore my
solution, don’t blame me.

And thats what I asked for help with if I can’t figure out how to
download restful_authentication, you think I can just go and magicly
download what ever alternitive plugin you suggested.

Because you can! The Rails plugin installation process is uniform. If
you can install one plugin, you can install them all.

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Sent from my iPhone

Look dude …no one helped me with this problem…I did figure it out on
my own, by googling and reading and googling and reading … books and
doc’s and I replied to my own question incase some one else accidently
messed with the routing file like I did.

All your response was, was a snobish trashing of my question and my own
response…

I wasn’t trashing anything. I was trying to explain how to do things
better. I assumed that since you were trying to learn Rails, you
actually wanted to learn to do things right. Was I mistaken? Did you
just want your ego stroked? Or something else? I really don’t get it.

do me a favor …ignore my questions…

That wouldn’t be doing you a favor. But I might do it anyway if you
don’t lose that attitude.

thanks

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Sent from my iPhone

Sorry reread you silly long elitest rant and just had to comment on one
or two more things

Umm… perhaps because long-time readers and posters on the forum assume
that you come to this forum to learn from people who have already
traveled the road you seem to be on… perhaps because restful routes
is a big thing in Rails, which happens to prefer convention over
configuration, and you seem to be thinking configuration, so perhaps a
redirect was in order…

I just wanted to test each page… you know throw the url in the
address to see if it looked right …to see if it was throwing the right
variables…it had nothing to do with a redirect or a link_to … but
the url in the address bar wasn’t working and I couldn’t find the answer
on line or in “ruby cook book” The pic axe ruby book or in agile Web
development … I just wanted to know why it didn’t work…thats it…
But dude went off the deep end…and I asked him… just don’t
respond…but he did again…

A great place for information is api.rubyonrails.org; another great
place is your own machine in the console window, and your development
log. Look in the dev log to see what the parameters are that your app
is receiving. Read the api (particularly the routing part) to better
understand that piece. When you used scaffold, did you just scaffold
the full deal (something like: script/generate scaffold person
last_name:string first_name:string ). That’ll generate the controller,
model, views, routing - rake that migration then play with that basic
app - read through the generated code to learn how it all fits - it is
amazingly educational about the Rails conventions. Generally, if it is
hard to do, you’re doing it wrong. Simple as that.

DID YOU READ ANY OF THE OTHER POSTS!!!
I figured out the problem long before Marnen came along with his break
down of my code…and thats the thing … I had figured out why and I
posted why so that if any other morons like me messed up route file with
map.resources… urls won’t work right! I was trying to be helpful…

I don’t always agree with Marnen’s opinions, and he does tend to state
things a bit strongly for my taste, but I do always read his posts.
Why? Because he knows more than I, and a hell of a lot more than you.

But as your later posts have indicated, you are not interested in
learning from anyone more knowledgeable than you in Ruby and Rails, you
just want an answer to your ‘user_loggin’ question so you can write the
code your way, however against the conventions of Ruby and/or Rails it
might be.

?? did apple stick with Microsofts conventions??
does apple stick with flash conventions??
I could stick to ruby convention better if they didn’t fricken change
it every 8 months…

and just for the record I’ve programmed in ruby enough that I was one of
the only people to find a naming convention foul up in the ror with Ruby
2.0
I had a model called test_drive for a car lot I was building a sight
for and ruby turned test_drives from the DB to test_drifes instead of
test_drives because its english converstion of lives is to life … so
drives was to drife…

and I’m sure I just got lucky finding that …wasn’t cuz I knew the
Controller, model veiw theory, or ever looked at my output screens… or
looked at what error was returned…

But now I know…if I ever have a simple question…if it’s answered
here…It comes with a handy dandy type till your blue in the face
…greater then thow lecture on ruby conventions…no extra charge or
nothing