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.

  1. imput should have been input.

  2. the url /posts/new, not /new.

  3. =f.input :submit should have been f.button.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -