开发者

html + rails question

Can I add ruby/ rails code inside an html page. My requ开发者_如何学编程irement is, get a partial to display in my html page

Is this possible and if yes please show me how.

My current code is:

index.html:

<%= render :partial => <partial>%>

So what I'm trying to do here is have the partial rendered to my html page.

I'm using rails 3 on ubuntu.

Thanks in advance.

Cheers, sameera


You can render partial like this:

<%= render :partial => 'name_of_partial', :locals => { :some_variable_to_pass_to_partial => "abcd" } %>

Here is some good information about layouts and views in Rails.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜