开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜