Friday, 15 May 2015

ruby on rails - How to make default_body of html for page -



ruby on rails - How to make default_body of html for page -

i working on project , @ time trying create default_body html of single page creator. know need utilize callback before_create :default_body...what stuck on this...

i have layout of page (html) written out. need html , set default_body. html need body :section attr. in section model need have (like said above..)

before_create :default_body before_create :default_layout def default_layout self.body = "" end end

i know need set html in there, surrounding "", dont think work. , if did work it'll give me html code, , not actual view of html. i'll need convert (if set string "") html. unless there's improve way.

i sense question confusing. if so, don't hesitate inquire questions or help me @ clarifying (if have ideas of need). kind of new ror (4 months). still learning. please help if can!

edit: need set between quotations. can't set actual div(code...)div in there..it wont work in model. trying firgure out right code set in there set have 'layout' (or div(code...div) in _form. pretty confusing me!

thank you!

html ruby-on-rails

No comments:

Post a Comment