开发者

How to use HTML framesets in Ruby on Rails?

I have a view called "chat.html.erb". Now this has a frameset with 2 frames. The code is:

<FRAMESET ROWS="65%,35% FRAMEBORDER='0' FRAMESPAC开发者_高级运维ING='0'>  

<FRAME NAME="DISP" SRC="CHAT_WINDOW.HTML.ERB">  

<FRAME NAME="TEXT" SRC="CHAT_WINDOW.HTML.ERB">  

</FRAMESET>

The two frames are both in the same directory as the chat.html.erb file. When I open the chat.html.erb file in a browser window I can see the stuff fine. But it doesn't get rendered in rails. What could be the problem?


To get a view rendered in Rails, you need at least the 2 components:

  • a Rails controller like ChatsController
  • a Rails action with a corresponding view like chat with the view chat.html.erb

You could then call that in your browser (when you have started your Rails application with rails s with http://localhost:3000/chats/chat. But you need an extra entry in your routes.rb file like: get 'chats/chat' so that Rails can match your URL to the right controller and action.

This is all just speculation, but without code :-) there is not much of a chance ...

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜