Hi,
I am adding login functionality to my app which has two controllers
users and photos and i am having some trouble.
In my users/index view
<%if logged_in? %>
<%=render "photos/index"%>
<%else%>
.... Home page With login.....
<%end%>
In my photos/index view
<%if logged_in? %>
.... Welcome page .....
<%else%>
<%=render "users/index"%>
<%end%>
Routes:
map.root :controller => ''user'', :action =>
''surahome''
When i login to the page, it redirects to http://www.example.com/photos
and the page displays correctly.
When i access the main url http://www.example.com
i got this error : Missing template photos/_index.erb in view path
app/views
I am working with rails 2.3.5
Any sugestions?
Thanks in advance
Senling
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
2010/1/22 senling <senthilupkm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> Hi, > I am adding login functionality to my app which has two controllers > users and photos and i am having some trouble. > > In my users/index view > > <%if logged_in? %> > <%=render "photos/index"%> > <%else%> > .... Home page With login..... > <%end%> > > In my photos/index view > > <%if logged_in? %> > .... Welcome page ..... > > <%else%> > <%=render "users/index"%> > <%end%> > > Routes: > map.root :controller => ''user'', :action => ''surahome''Should that be ''users''?> > > > When i login to the page, it redirects to http://www.example.com/photos > and the page displays correctly. > > When i access the main url http://www.example.com > > i got this error : Missing template photos/_index.erb in view path > app/viewsWhat do you see in development.log when you do this? Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
Controller name user.
I have changed to user/index, still same error.
Development.log:
****************
Processing UserController#surahome (for 192.168.1.5 at 2010-01-23
00:09:08) [GET]
Rendering template within layouts/standard
Rendering user/surahome
ActionView::TemplateError (Missing template sandbox/_index.erb in view
path app/views) on line #4 of app/views/user/surahome.html.erb:
1: <title>Sura Systems</title>
2:
3: <%if logged_in? %>
4: <%=render "sandbox/index"%>
5: <%else%>
6:
7: <div id="content">
app/views/user/surahome.html.erb:4
/usr/lib/ruby/1.8/thread.rb:135:in `synchronize''
fcgi (0.8.7) lib/fcgi.rb:117:in `session''
fcgi (0.8.7) lib/fcgi.rb:104:in `each_request''
fcgi (0.8.7) lib/fcgi.rb:36:in `each''
dispatch.fcgi:24
Rendered rescues/_trace (143.9ms)
Rendered rescues/_request_and_response (0.5ms)
Rendering rescues/layout (internal_server_error)
*****************************************************************************
On Jan 22, 4:19 pm, Colin Law
<clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
wrote:> 2010/1/22 senling
<senthilu...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
>
>
>
> > Hi,
> > I am adding login functionality to my app which has two controllers
> > users and photos and i am having some trouble.
>
> > In my users/index view
>
> > <%if logged_in? %>
> > <%=render "photos/index"%>
> > <%else%>
> > .... Home page With login.....
> > <%end%>
>
> > In my photos/index view
>
> > <%if logged_in? %>
> > .... Welcome page .....
>
> > <%else%>
> > <%=render "users/index"%>
> > <%end%>
>
> > Routes:
> > map.root :controller => ''user'', :action =>
''surahome''
>
> Should that be ''users''?
>
>
>
> > When i login to the page, it redirects
tohttp://www.example.com/photos
> > and the page displays correctly.
>
> > When i access the main urlhttp://www.example.com
>
> > i got this error : Missing template photos/_index.erb in view path
> > app/views
>
> What do you see in development.log when you do this?
>
> Colin
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
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.
Controller name user.
I have changed to user/index, still same error.
Development.log:
****************
Processing UserController#index (for 192.168.1.5 at 2010-01-23
00:09:08) [GET]
Rendering template within layouts/standard
Rendering user/index
ActionView::TemplateError (Missing template sandbox/_index.erb in view
path app/views) on line #4 of app/views/user/index.html.erb:
1: <title>Sura Systems</title>
2:
3: <%if logged_in? %>
4: <%=render "sandbox/index"%>
5: <%else%>
6:
7: <div id="content">
app/views/user/index.html.erb:4
/usr/lib/ruby/1.8/thread.rb:135:in `synchronize''
fcgi (0.8.7) lib/fcgi.rb:117:in `session''
fcgi (0.8.7) lib/fcgi.rb:104:in `each_request''
fcgi (0.8.7) lib/fcgi.rb:36:in `each''
dispatch.fcgi:24
Rendered rescues/_trace (143.9ms)
Rendered rescues/_request_and_response (0.5ms)
Rendering rescues/layout (internal_server_error)
*****************************************************************************
On Jan 22, 4:19 pm, Colin Law
<clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
wrote:> 2010/1/22 senling
<senthilu...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
>
>
>
> > Hi,
> > I am adding login functionality to my app which has two controllers
> > user and photos and i am having some trouble.
>
> > In my user/index view
>
> > <%if logged_in? %>
> > <%=render "photos/index"%>
> > <%else%>
> > .... Home page With login.....
> > <%end%>
>
> > In my photos/index view
>
> > <%if logged_in? %>
> > .... Welcome page .....
>
> > <%else%>
> > <%=render "user/index"%>
> > <%end%>
>
> > Routes:
> > map.root :controller => ''user'', :action =>
''index''
>
> Should that be ''users''?
>
>
>
> > When i login to the page, it redirects
tohttp://www.example.com/photos
> > and the page displays correctly.
>
> > When i access the main urlhttp://www.example.com
>
> > i got this error : Missing template photos/_index.erb in view path
> > app/views
>
> What do you see in development.log when you do this?
>
> Colin
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
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.
On 23 January 2010 07:20, senling <senthilupkm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Controller name user. > > I have changed to user/index, still same error. > > Development.log: > **************** > > Processing UserController#index (for 192.168.1.5 at 2010-01-23 > 00:09:08) [GET] > Rendering template within layouts/standard > Rendering user/index > > ActionView::TemplateError (Missing template sandbox/_index.erb in view > path app/views) on line #4 of app/views/user/index.html.erb: > 1: <title>Sura Systems</title> > 2: > 3: <%if logged_in? %> > 4: <%=render "sandbox/index"%>That is looking for sandbox/_index.erb, which you have apparently not provided Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
hits: redirect_to :controller => ''photos'', :action => ''index'' 2010/1/23 Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>> On 23 January 2010 07:20, senling <senthilupkm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Controller name user. > > > > I have changed to user/index, still same error. > > > > Development.log: > > **************** > > > > Processing UserController#index (for 192.168.1.5 at 2010-01-23 > > 00:09:08) [GET] > > Rendering template within layouts/standard > > Rendering user/index > > > > ActionView::TemplateError (Missing template sandbox/_index.erb in view > > path app/views) on line #4 of app/views/user/index.html.erb: > > 1: <title>Sura Systems</title> > > 2: > > 3: <%if logged_in? %> > > 4: <%=render "sandbox/index"%> > > That is looking for sandbox/_index.erb, which you have apparently not > provided > > Colin > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- tommy xiao E-mail: xiaods(AT)gmail.com -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.