开发者

Ruby on Rails: How do I pass @variables to an iframe? (Goal: Sandboxing part of a page)

So, i figured, that I'd have to do this with the URL, rather than rails magic, cause I haven't found anything on iframes and rails...

<iframe src="/content_container/<%@object.id%>?page=<%@page%>" width="665" height="85%" frameborder="0">

but... when i get an error: it show this

Request

Parameters:

{"page"=>""}

Any ideas? or a better way?

My ultimate goal is to sandbox t开发者_StackOverflow社区he js and CSS for an object, apart from the rest of the page... so i figured an iframe would work.


You forgot the = signs:

<%=@object.id%>?page=<%=@page%>


URL or session, there's no other (straightforward) way to pass data between two requests (which is what, in effect, you're dealing with here).

(I am using "session" broadly here - any permanent or semi-permanent storage using user's unique identification as a key; and I also incorrectly include POST parameters into the URL method; but you know what I mean.)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜