ruby - Model with defined attribute returns nil, despite showing a value. Rails 4 Postgres Heroku -
i have set simple rails app, , have deployed heroku. store content displayed on site, have set model content
attribute bio
, , populate rake task on deploy.
in dev, well. can populate model, reference in controller, , display on page. simple, right?
however once push heroku, can't model return value, desipite seeing on select. example, console yields:
irb(main):006:0> c = content.first => #<content id: 1, bio: "<p class='bio_text'>hunter writer and..."> irb(main):008:0> c.bio => nil
the value in db, gives?
i'm using rails 4.1.8, hosted on heroku, running postgres 9.8.1.
model:
class content < activerecord::base end
controller:
class pagescontroller < applicationcontroller def bio @bio_content = content.last.bio end ... private def content_params params.require(:content).permit(:bio) end end
Comments
Post a Comment