Forum: Ruby on Rails Keep getting this error after running scaffold command

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
78947e02afdcaabbda360f9d112bfbe0?d=identicon&s=25 Musdev Musdev (devrubygem)
on 2009-05-14 07:04
I ran  ruby script/generate scaffold Ticket artist:string seat#:integer
price:integer ticket_price:float  in my terminal
Then I entered rake db:migrate

I went to http://localhost:3000/tickets
and I'm getting this error shown below,

 Showing app/views/tickets/index.html.erb where line #21 raised:

compile error
/Users/musdev/peepcode/views_demo/app/views/tickets/index.html.erb:21:
syntax error, unexpected kEND, expecting ')'
;  end ; @output_buffer.concat "\n</table>\n\n<br />\n\n"
      ^
/Users/musdev/peepcode/views_demo/app/views/tickets/index.html.erb:28:
syntax error, unexpected kENSURE, expecting ')'
/Users/musdev/peepcode/views_demo/app/views/tickets/index.html.erb:30:
syntax error, unexpected kEND, expecting ')'

Extracted source (around line #21):

18:     <td><%= link_to 'Edit', edit_ticket_path(ticket) %></td>
19:     <td><%= link_to 'Destroy', ticket, :confirm => 'Are you sure?',
:method => :delete %></td>
20:   </tr>
21: <% end %>
22: </table>
23:
24: <br />


I usually run the scaffold command and never had this issue before

Thanks
5772c599ccab3081e0fffb1d54f3b6de?d=identicon&s=25 Andrew Timberlake (andrewtimberlake)
on 2009-05-14 07:21
(Received via mailing list)
On Thu, May 14, 2009 at 7:04 AM, Zayd Connor
<rails-mailing-list@andreas-s.net> wrote:
> compile error
>
> I usually run the scaffold command and never had this issue before
>
> Thanks


Should you have the '#' after seat?
Have you tried it without the '#'? Perhaps seat_no

Andrew Timberlake
http://ramblingsonrails.com
http://www.linkedin.com/in/andrewtimberlake

"I have never let my schooling interfere with my education" - Mark Twain
Af2ce6689213fdb78913a9662b18da6b?d=identicon&s=25 Rick Lloyd (ricklloyd)
on 2009-05-14 07:23
(Received via mailing list)
# is a special character for ruby.  All that follows to the end of
line is a comment.

On May 13, 7:04 pm, Zayd Connor <rails-mailing-l...@andreas-s.net>
78947e02afdcaabbda360f9d112bfbe0?d=identicon&s=25 Musdev Musdev (devrubygem)
on 2009-05-14 07:43
Andrew Timberlake wrote:
> On Thu, May 14, 2009 at 7:04 AM, Zayd Connor
> <rails-mailing-list@andreas-s.net> wrote:
>> compile error
>>
>> I usually run the scaffold command and never had this issue before
>>
>> Thanks
>
>
> Should you have the '#' after seat?
> Have you tried it without the '#'? Perhaps seat_no
>
> Andrew Timberlake
> http://ramblingsonrails.com
> http://www.linkedin.com/in/andrewtimberlake
>
> "I have never let my schooling interfere with my education" - Mark Twain

No I haven't tried yet, can i run the same command again of course
without the # ?
or do I have to delete the ticket table first? How do I go about
removing the ticket table?

Thanks
5772c599ccab3081e0fffb1d54f3b6de?d=identicon&s=25 Andrew Timberlake (andrewtimberlake)
on 2009-05-14 08:48
(Received via mailing list)
On Thu, May 14, 2009 at 7:43 AM, Zayd Connor
<rails-mailing-list@andreas-s.net> wrote:
>>
> without the # ?
> or do I have to delete the ticket table first? How do I go about
> removing the ticket table?
>
> Thanks

Just go into the database ./script/dbconsole and run drop table tickets

Andrew Timberlake
http://ramblingsonrails.com
http://www.linkedin.com/in/andrewtimberlake

"I have never let my schooling interfere with my education" - Mark Twain
This topic is locked and can not be replied to.