Hey, I'm writing a website like 4chan. I have two models: I do this in my opinion and my good The problem is that always a For example, I have no However, when I present it as a JSON, there is no Before I do this, I can remove it and remove it from a Try pictures. Instead. Any? board and pictures . A board has several images s:
class board & lt; ActiveRecord :: Base # Relationships has_many: Picture, Dependent = & gt; : Delete the class and the picture & lt; ActiveRecord :: Base # Relationship related_to: board end boards / show.html.haml :
- If @ board picture. someone? - @ Board.Picture% Article.picture- Article {: id = & gt; "Image - # {picture.id}"} - if picture.title? % Header% h2 = picture.title% img {: src = & gt; Picture.pic.url ,: alt = & gt; (Picture.title ?? Picture.title: 'untitled pic')} /% pre ~ picture.description - else meh This board is still empty board controller In the :
df show @ board = board.fund_b_short_name parameter [: id] expiration
board not picture s in the DB (this is with the picture) shown as image which is empty All ), but this output is:
& lt ; Article class = 'image-text' id = 'image -' & gt; & Lt; Img alt = 'untitled photo' src = '/ pics / original / missing.png' & gt; & Lt; Pre & gt; & Lt; / Pre & gt; & Lt; / Article & gt;
image s with the output, as it should be: < / P>
{"board": {"name": "n00bs", "created_at": "2011-03-16T17: 14: 32Z", "updated_at": "2011-03-16T17: 14: 32Z "," id ": 14," short_name ":" 0 "," picture ": []}}
every but the bug still remains and this super-duper is clumsy, how can it be? Why does @ board picture always empty an empty image object?
Comments
Post a Comment