Skip to main content

ruby on rails 3 - Extend a view with array of models (not join) -


i'm trying extend view reusing views i've made. i've no partials , simplified directory views.

views -- properties -- index.json.rabl -- show.json.rabl -- type -- index.json.rabl -- show.json.rabl 

i saw examples on how extend using child method, solution works have relation model. looked extends, in case didn't go far.

here sample code came , not working right now. have suggestions? i've been reading docs , different articles couldn't come out working.

 object typedecorator.decorate(@type) attributes :uri, :id, :name, :public node(:properties) |type| collection property.in(_id: type.property_ids) extends 'properties/index' end 

ruby on rails 3 - extend view array of models (not join) - stack overflow

learn, share, build

each month, on 50 million developers come stack overflow learn, share knowledge, , build careers.

join world’s largest developer community.

sign up

i'm trying extend view reusing views i've made. i've no partials , simplified directory views.

views -- properties -- index.json.rabl -- show.json.rabl -- type -- index.json.rabl -- show.json.rabl 

i saw examples on how extend using child method, solution works have relation model. looked extends, in case didn't go far.

here sample code came , not working right now. have suggestions? i've been reading docs , different articles couldn't come out working.

 object typedecorator.decorate(@type) attributes :uri, :id, :name, :public node(:properties) |type| collection property.in(_id: type.property_ids) extends 'properties/index' end 
share|improve question
1  
shouldn't a reusable partial? defining methods in view reuse on other pages? question cleared bit. – earlonrails jul 6 '12 @ 21:54
    
a partial perfect, totally forgot possibility while hitting in problem. anyway curious know if there solution without partials. i've cleaned question make more clear. – andrea reginato jul 6 '12 @ 22:06

your answer

 
discard

posting answer, agree privacy policy , terms of service.

browse other questions tagged or ask own question.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -