Syntax error


L

Luis Teko

SyntaxError in Movie#new
compile error
D:/instant/rails_apps/videoondemand/app/views/movie/new.html.erb:8:
syntax error, unexpected ':', expecting ')'
_erbout.concat(( collection_select:)movie,:genre_id,@genres:id,:name)
).to_s); _erbout.concat "</p>\n"
^
D:/instant/rails_apps/videoondemand/app/views/movie/new.html.erb:8:
syntax error, unexpected ')', expecting tCOLON2 or '[' or '.'
_erbout.concat(( collection_select:)movie,:genre_id,@genres:id,:name)
).to_s); _erbout.concat "</p>\n"
^
Extracted source (around line #8):

5: <p><label for="movie_price">Price</label>:
6: <%= text_field 'movie', 'price' %></p>
7: <p><label for="movie_genre">Genre</label>:
8: <%= collection_select:)movie,:genre_id,@genres:id,:name) %></p>
9: <p><label for="movie_description">Description</label><br/>
10: <%= text_area 'movie', 'description' %></p>
11: <%= submit_tag "Create" %>

Trace of template inclusion: /movie/new.html.erb

RAILS_ROOT: D:/instant/rails_apps/videoondemand
Application Trace | Framework Trace | Full Trace

app/views/movie/new.html.erb:15:in `compile_template'
D:/instant/ruby/bin/mongrel_rails:19

Request

Parameters:

None
heres my new.rhtm
<h1>Add new movie</h1>
<%= form_tag :action => 'create' %>
<p><label for="movie_title">Title</label>:
<%= text_field 'movie', 'title' %></p>
<p><label for="movie_price">Price</label>:
<%= text_field 'movie', 'price' %></p>
<p><label for="movie_genre">Genre</label>:
<%= collection_select:)movie,:genre_id,@genres:id,:name) %></p>
<p><label for="movie_description">Description</label><br/>
<%= text_area 'movie', 'description' %></p>
<%= submit_tag "Create" %>
<%= link_to 'Back', {:action => 'list'} %>


class Movie < ActiveRecord::Base
belongs_to :genre

end

class Genre < ActiveRecord::Base
has_many :movies
end
 
Ad

Advertisements

F

Fabian Streitel

[Note: parts of this message were removed to make it a legal post.]

It would have been nice if you had asked a question, but anyways
_erbout.concat(( collection_select:)movie,:genre_id,@genres:id,:name)

I guess you meant @genres.id, not @genres:id

Greetz!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top