Hello, ''m new to RoR. I was facing one prob and ''m unable to figure out my mistake. can anyone pls help me? the error is ******************************************************************************************************** SyntaxError in Pages#index Showing pages/index.html.erb where line #4 raised: compile error C:/rails/railscoder/app/views/pages/index.html.erb:4: dynamic constant assignment _erbout.concat "\t"; @pages.each do |Page| ; _erbout.concat "\n" ^ Extracted source (around line #4): 1: <h2>All Pages</h2> 2: 3: <ul> 4: <% @pages.each do |Page| %> 5: <li> 6: <%= Page.permalink %> :<%= Page.title s%> 7: </li> Trace of template inclusion: /pages/index.html.erb RAILS_ROOT: C:/rails/railscoder ******************************************************************************************************** One thing that confuses me alot is.... does view file have extension .rhtml or .html.erb ??? Any help is highly appreciated. Thanks -Ashit Vora --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
put <%end%> On Sat, Jun 21, 2008 at 12:34 PM, Ashit Vora <a.k.vora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hello, > ''m new to RoR. > I was facing one prob and ''m unable to figure out my mistake. can > anyone pls help me? > > the error is > > ******************************************************************************************************** > SyntaxError in Pages#index > > Showing pages/index.html.erb where line #4 raised: > > compile error > C:/rails/railscoder/app/views/pages/index.html.erb:4: dynamic constant > assignment > _erbout.concat "\t"; @pages.each do |Page| ; _erbout.concat "\n" > ^ > > Extracted source (around line #4): > > 1: <h2>All Pages</h2> > 2: > 3: <ul> > 4: <% @pages.each do |Page| %> > 5: <li> > 6: <%= Page.permalink %> :<%= Page.title s%> > 7: </li> > > Trace of template inclusion: /pages/index.html.erb > > RAILS_ROOT: C:/rails/railscoder > > > ******************************************************************************************************** > > One thing that confuses me alot is.... does view file have > extension .rhtml or .html.erb ??? > > > Any help is highly appreciated. > Thanks > -Ashit Vora > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Still the same error... May I know, Can the extension of View file be *.html.erb* ??? I heard that it should be .*rhtml.* But in my case rails auto generated it with extension *.html.erb* On Sat, Jun 21, 2008 at 12:16 AM, bala kishore pulicherla < balumca21-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> put > <%end%> > > On Sat, Jun 21, 2008 at 12:34 PM, Ashit Vora <a.k.vora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> >> Hello, >> ''m new to RoR. >> I was facing one prob and ''m unable to figure out my mistake. can >> anyone pls help me? >> >> the error is >> >> ******************************************************************************************************** >> SyntaxError in Pages#index >> >> Showing pages/index.html.erb where line #4 raised: >> >> compile error >> C:/rails/railscoder/app/views/pages/index.html.erb:4: dynamic constant >> assignment >> _erbout.concat "\t"; @pages.each do |Page| ; _erbout.concat "\n" >> ^ >> >> Extracted source (around line #4): >> >> 1: <h2>All Pages</h2> >> 2: >> 3: <ul> >> 4: <% @pages.each do |Page| %> >> 5: <li> >> 6: <%= Page.permalink %> :<%= Page.title s%> >> 7: </li> >> >> Trace of template inclusion: /pages/index.html.erb >> >> RAILS_ROOT: C:/rails/railscoder >> >> >> ******************************************************************************************************** >> >> One thing that confuses me alot is.... does view file have >> extension .rhtml or .html.erb ??? >> >> >> Any help is highly appreciated. >> Thanks >> -Ashit Vora >> >> > > > >-- Ashit Vora Yahoo: vora_ashit Gtalk: a.k.vora Skype: ashit.vora "It is futile to be overconfident about your ability. Exercise caution wherever necessary." --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
whn u use scaffold rails auto generate the view files with the extension .html.erb it can be either .rhtml or html.erb the problem is with the variable that ur using :( u can''t use Page bcz itz a key word for ex request,Page,response ...... (these are the key words so u cant use them) change ur variable name to page or some thing else On Sat, Jun 21, 2008 at 12:51 PM, Ashit Vora <a.k.vora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Still the same error... > May I know, Can the extension of View file be *.html.erb* ??? > I heard that it should be .*rhtml.* But in my case rails auto generated it > with extension *.html.erb* > > > On Sat, Jun 21, 2008 at 12:16 AM, bala kishore pulicherla < > balumca21-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> put >> <%end%> >> >> On Sat, Jun 21, 2008 at 12:34 PM, Ashit Vora <a.k.vora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> >>> Hello, >>> ''m new to RoR. >>> I was facing one prob and ''m unable to figure out my mistake. can >>> anyone pls help me? >>> >>> the error is >>> >>> ******************************************************************************************************** >>> SyntaxError in Pages#index >>> >>> Showing pages/index.html.erb where line #4 raised: >>> >>> compile error >>> C:/rails/railscoder/app/views/pages/index.html.erb:4: dynamic constant >>> assignment >>> _erbout.concat "\t"; @pages.each do |Page| ; _erbout.concat "\n" >>> ^ >>> >>> Extracted source (around line #4): >>> >>> 1: <h2>All Pages</h2> >>> 2: >>> 3: <ul> >>> 4: <% @pages.each do |Page| %> >>> 5: <li> >>> 6: <%= Page.permalink %> :<%= Page.title s%> >>> 7: </li> >>> >>> Trace of template inclusion: /pages/index.html.erb >>> >>> RAILS_ROOT: C:/rails/railscoder >>> >>> >>> ******************************************************************************************************** >>> >>> One thing that confuses me alot is.... does view file have >>> extension .rhtml or .html.erb ??? >>> >>> >>> Any help is highly appreciated. >>> Thanks >>> -Ashit Vora >>> >>> >> >> >> > > > -- > Ashit Vora > > > > Yahoo: vora_ashit > Gtalk: a.k.vora > Skype: ashit.vora > > "It is futile to be overconfident about your ability. Exercise caution > wherever necessary." > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
*************************************************************** Controller class PagesController < ApplicationController def index @pages = Page.find (:all) end end View <h2>All Pages</h2> <ul> <% @pages.each do |Page| %> <li> <%= Page.title %> </li> <% end %> </ul> I donno why the View is named index.html.erb (instead of index.rhtml) *************************************************************** Thanks On Jun 21, 12:16 am, "bala kishore pulicherla" <balumc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> put > <%end%> > > On Sat, Jun 21, 2008 at 12:34 PM, Ashit Vora <a.k.v...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hello, > > ''m new to RoR. > > I was facing one prob and ''m unable to figure out my mistake. can > > anyone pls help me? > > > the error is > > > ******************************************************************************************************** > > SyntaxError in Pages#index > > > Showing pages/index.html.erb where line #4 raised: > > > compile error > > C:/rails/railscoder/app/views/pages/index.html.erb:4: dynamic constant > > assignment > > _erbout.concat "\t"; @pages.each do |Page| ; _erbout.concat "\n" > > ^ > > > Extracted source (around line #4): > > > 1: <h2>All Pages</h2> > > 2: > > 3: <ul> > > 4: <% @pages.each do |Page| %> > > 5: <li> > > 6: <%= Page.permalink %> :<%= Page.title s%> > > 7: </li> > > > Trace of template inclusion: /pages/index.html.erb > > > RAILS_ROOT: C:/rails/railscoder > > > ******************************************************************************************************** > > > One thing that confuses me alot is.... does view file have > > extension .rhtml or .html.erb ??? > > > Any help is highly appreciated. > > Thanks > > -Ashit Vora--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hurre... Changing Page to page worked.. Thanks alot... :) On Jun 21, 12:42 am, Ashit Vora <a.k.v...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> *************************************************************** > Controller > > class PagesController < ApplicationController > > def index > @pages = Page.find (:all) > end > end > > View > <h2>All Pages</h2> > > <ul> > <% @pages.each do |Page| %> > <li> > <%= Page.title %> > </li> > <% end %> > </ul> > > I donno why the View is named index.html.erb (instead of index.rhtml) > *************************************************************** > > Thanks > > On Jun 21, 12:16 am, "bala kishore pulicherla" <balumc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > put > > <%end%> > > > On Sat, Jun 21, 2008 at 12:34 PM, Ashit Vora <a.k.v...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hello, > > > ''m new to RoR. > > > I was facing one prob and ''m unable to figure out my mistake. can > > > anyone pls help me? > > > > the error is > > > > ******************************************************************************************************** > > > SyntaxError in Pages#index > > > > Showing pages/index.html.erb where line #4 raised: > > > > compile error > > > C:/rails/railscoder/app/views/pages/index.html.erb:4: dynamic constant > > > assignment > > > _erbout.concat "\t"; @pages.each do |Page| ; _erbout.concat "\n" > > > ^ > > > > Extracted source (around line #4): > > > > 1: <h2>All Pages</h2> > > > 2: > > > 3: <ul> > > > 4: <% @pages.each do |Page| %> > > > 5: <li> > > > 6: <%= Page.permalink %> :<%= Page.title s%> > > > 7: </li> > > > > Trace of template inclusion: /pages/index.html.erb > > > > RAILS_ROOT: C:/rails/railscoder > > > > ******************************************************************************************************** > > > > One thing that confuses me alot is.... does view file have > > > extension .rhtml or .html.erb ??? > > > > Any help is highly appreciated. > > > Thanks > > > -Ashit Vora--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
did u get fixed?? On Jun 21, 12:42 pm, Ashit Vora <a.k.v...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> *************************************************************** > Controller > > class PagesController < ApplicationController > > def index > @pages = Page.find (:all) > end > end > > View > <h2>All Pages</h2> > > <ul> > <% @pages.each do |Page| %> > <li> > <%= Page.title %> > </li> > <% end %> > </ul> > > I donno why the View is named index.html.erb (instead of index.rhtml) > *************************************************************** > > Thanks > > On Jun 21, 12:16 am, "bala kishore pulicherla" <balumc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > put > > <%end%> > > > On Sat, Jun 21, 2008 at 12:34 PM, Ashit Vora <a.k.v...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hello, > > > ''m new to RoR. > > > I was facing one prob and ''m unable to figure out my mistake. can > > > anyone pls help me? > > > > the error is > > > > ******************************************************************************************************** > > > SyntaxError in Pages#index > > > > Showing pages/index.html.erb where line #4 raised: > > > > compile error > > > C:/rails/railscoder/app/views/pages/index.html.erb:4: dynamic constant > > > assignment > > > _erbout.concat "\t"; @pages.each do |Page| ; _erbout.concat "\n" > > > ^ > > > > Extracted source (around line #4): > > > > 1: <h2>All Pages</h2> > > > 2: > > > 3: <ul> > > > 4: <% @pages.each do |Page| %> > > > 5: <li> > > > 6: <%= Page.permalink %> :<%= Page.title s%> > > > 7: </li> > > > > Trace of template inclusion: /pages/index.html.erb > > > > RAILS_ROOT: C:/rails/railscoder > > > > ******************************************************************************************************** > > > > One thing that confuses me alot is.... does view file have > > > extension .rhtml or .html.erb ??? > > > > Any help is highly appreciated. > > > Thanks > > > -Ashit Vora--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Yea, I was able to fix the error... The prob was with variable name(Page) as u said. Thanks again. On Jun 21, 12:45 am, balu <balumc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> did u get fixed?? > > On Jun 21, 12:42 pm, Ashit Vora <a.k.v...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > *************************************************************** > > Controller > > > class PagesController < ApplicationController > > > def index > > @pages = Page.find (:all) > > end > > end > > > View > > <h2>All Pages</h2> > > > <ul> > > <% @pages.each do |Page| %> > > <li> > > <%= Page.title %> > > </li> > > <% end %> > > </ul> > > > I donno why the View is named index.html.erb (instead of index.rhtml) > > *************************************************************** > > > Thanks > > > On Jun 21, 12:16 am, "bala kishore pulicherla" <balumc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > > put > > > <%end%> > > > > On Sat, Jun 21, 2008 at 12:34 PM, Ashit Vora <a.k.v...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hello, > > > > ''m new to RoR. > > > > I was facing one prob and ''m unable to figure out my mistake. can > > > > anyone pls help me? > > > > > the error is > > > > > ******************************************************************************************************** > > > > SyntaxError in Pages#index > > > > > Showing pages/index.html.erb where line #4 raised: > > > > > compile error > > > > C:/rails/railscoder/app/views/pages/index.html.erb:4: dynamic constant > > > > assignment > > > > _erbout.concat "\t"; @pages.each do |Page| ; _erbout.concat "\n" > > > > ^ > > > > > Extracted source (around line #4): > > > > > 1: <h2>All Pages</h2> > > > > 2: > > > > 3: <ul> > > > > 4: <% @pages.each do |Page| %> > > > > 5: <li> > > > > 6: <%= Page.permalink %> :<%= Page.title s%> > > > > 7: </li> > > > > > Trace of template inclusion: /pages/index.html.erb > > > > > RAILS_ROOT: C:/rails/railscoder > > > > > ******************************************************************************************************** > > > > > One thing that confuses me alot is.... does view file have > > > > extension .rhtml or .html.erb ??? > > > > > Any help is highly appreciated. > > > > Thanks > > > > -Ashit Vora--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---