New action in index view
I want to have my new view and action (which displays a form in a modal dialogue) to be contained within the index view. How can I do this? Right now I get an error, and I assume it's because I have <%= form_for(@video) do |f| %>
when @video
is only defined in the new view and开发者_开发知识库 not the index view. I'm not sure how to correct this though...
Add @video = Video.new
in your video controller:
def index
@video = Video.new
end
精彩评论