I have a user controller with login as action.
When I access the index.html.erb file via application.layout file. I get a
error on the login link on the index.html.erb page. I think I am having
dfifficulty in setting up path to an action or even understanding how to set
REST path properly. Can someone please help me.
Here is the error on the home page:
C:/RoR/health/app/views/home/index.html.erb:3: syntax error, unexpected
tIDENTIFIER, expecting ')'
...link_to 'Login' login_user_path(user) ).to_s); @output_buffe...
... ^
Extracted source (around line #3):
1: <h1>Home app/views/home/index.html.erb</h1>
2:
3: <%= link_to 'Login' login_user_path(user) %>
]
Here is my index.html.erb
<h1>Welcome </h1>
<%= link_to 'Login' login_user_path %>
I also tried various other formats for the path:
<%= link_to 'Login' login_user_path(user) %>
<%= link_to 'Login' user_path %>
The error repeats at the same line.
Here is the login.html.erb
<% form_tag :action=> 'Login' do %>
<h3>Login</h3>
<label for="user_login">Login:</label><br/>
<%= text_field "user", "login", :size => 20 %><br/>
<label for="user_password">Password:</label><br/>
<%= password_field "user", "password", :size => 20 %><br/>
<%= submit_tag "Submit" %>
<%= link_to 'Register', :action => 'signup' %> |
<%= link_to 'Forgot my password', :action => 'forgot_password' %>
<% end %>
I have a user controller with login as action.
When I access the index.html.erb file via application.layout file. I
get a
error on the login link on the index.html.erb page. I think I am
having
dfifficulty in setting up path to an action or even understanding
how to set
REST path properly. Can someone please help me.
Here is the error on the home page:
C:/RoR/health/app/views/home/index.html.erb:3: syntax error,
unexpected
tIDENTIFIER, expecting ')'
...link_to 'Login' login_user_path(user) ).to_s); @output_buffe...
... ^
Extracted source (around line #3):
1: <h1>Home app/views/home/index.html.erb</h1>
2:
3: <%= link_to 'Login' login_user_path(user) %>
]
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
The above route should haveve created default paths that I would like to
use? If so can you tell me what would they be based on the route entry.
Wow, you really want to look into named routes.
The only two names that you have are:
root_path
login_path
and neither takes an argument.
Typically, your login action doesn't have a known user because that't really the point of logging in, isn't it?
map.resources :users
would give you a set of named RESTful routes.
The Rails documentation will give you all the details.
-Rob
-Rob
Rob Biedenharn-2 wrote:
I have a user controller with login as action.
When I access the index.html.erb file via application.layout file. I
get a
error on the login link on the index.html.erb page. I think I am
having
dfifficulty in setting up path to an action or even understanding
how to set
REST path properly. Can someone please help me.
Here is the error on the home page:
C:/RoR/health/app/views/home/index.html.erb:3: syntax error,
unexpected
tIDENTIFIER, expecting ')'
...link_to 'Login' login_user_path(user) ).to_s); @output_buffe...
... ^
Extracted source (around line #3):
1: <h1>Home app/views/home/index.html.erb</h1>
2:
3: <%= link_to 'Login' login_user_path(user) %>
]
--
You received this message because you are subscribed to the Google
Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
.
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
--
You received this message because you are subscribed to the Google
Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-
talk@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.