开发者

How do i access another engines model?

开发者 https://www.devze.com 2023-03-27 19:08 出处:网络
I have created a custom engine in Refinery and its working fine. I\'ve created a partial view called \'Showcase\" in the views folder for this model. I\'d like to be able to display that partial in my

I have created a custom engine in Refinery and its working fine. I've created a partial view called 'Showcase" in the views folder for this model. I'd like to be able to display that partial in my homepage of the main site.

The model is called projects, and I included the line:

<%= render :partial => "projects/showcase" %>

It didnt like this, keeps saying there are no such methods for my @projects model. It's finding the page, but refuses to accept @projects is something i can play with. I have tried running this partial off the index page in the projects engine itself and it works fine. It must have something to do with me calling it from another place in the project.

I also tried:

<%= render :partial => "projects/showcase" :collection => @projects %>

and

<%= render :partial => "projects/showcase" :object => @projects %>

which didn't return me any different results.

Appreciate your h开发者_开发问答elp!


You are setting @projects in the proper method of your homepage controller, right?

0

精彩评论

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