SyntaxError in Videos#show
Showing /rubyprograms/dreamstill/app/views/videos/show.html.erb where line #54 raised:
compile error
/Library/Ruby/Gems/1.8/gems/activemodel-3.0.4/lib/active_model/attribute_methods.rb:272: syntax error, unexpected ')'
/Library/Ruby/Gems/1.8/gems/activemodel-3.0.4/lib/active_model/attribute_methods.rb:273: syntax error, unexpected '?', expecting $end
Extracted source (around line #54):
51: <%= link_to "Show Song", '#', :id => 'video_show_link', :class => 'edit' %>
52:
53: <div id="showable_video_div">
54: <%= form_for [@video, @video.showable_videos.new ], :url => showable_videos_path, :remote => true do |f| %>
55: <%= f.hidden_field :video_id, :value => @video.id, :id => "video_id_field" %>
56: <%= f.text_field :user, :class => "showable_field" %>
57: <% end %>
這是遷移到我做得對拋出的錯誤之前的showable_videos
表:我的語法錯誤在哪裏?
class AddUpvotedAndSeenToShowableVideos < ActiveRecord::Migration
def self.up
add_column :showable_videos, :upvoted?, :boolean
add_column :showable_videos, :seen?, :boolean
end
def self.down
remove_column :showable_videos, :seen?
remove_column :showable_videos, :upvoted?
end
end
什麼是'[@video,@ video.showable_videos.new]'應該產生? – theIV 2011-05-20 04:44:59
語法錯誤在您的標題中。 Wheres ==> – sawa 2011-05-20 04:47:24
在視頻模型中:'has_many:showable_videos' – user730569 2011-05-20 04:47:41