ruby on rails - Cannot get new posts form to appear -
on cloud9, i'm building instagram clone in journey of learning ror. 1 of steps listed (which purposefully vague, push students reach out , learn vs being given answer) add following:
= simple_form_for @post |f| =f.input :image =f.input :caption =f.input :submit
no errors kicked off, looks working fine. restarted rails s. following written
"in case, want create new post. add @post
variable new action."
so, thought meant in posts_controllers.rb
, add following:
def new @post = post.create end
so what's in posts
controller:
class postscontroller < applicationcontroller def index @posts = post.all end def create @post = post.create end end
everytime following:
no route matches [get] "/new
what doing wrong?
there typo in simple_form
.
imput
should have beeninput
.the url
/posts/new
, not/new
.=f.input :submit
should have beenf.button
.
Comments
Post a Comment