undefined method `lessons_path'

Hi all! I'm new to Rails and i have some problems with this code.

I have this form in a view of page controller <%= form_for Lesson.new do %> <%= label_tag(:number, "Enter the number") %>     <%= text_field_tag :number %>         <%= label_tag(:root, "root") %>         <%= text_field_tag :root %>     <%= submit_tag("Submit") %>         <% end %>

In Lesson controller i've methods new create and soo on. I'm not sure how to use this form in another view. I have this error undefined method `lessons_path' I repeat i'm new to rails, have 2 days:))

Hi all! I'm new to Rails and i have some problems with this code.

I have this form in a view of page controller <%= form_for Lesson.new do %> <%= label_tag(:number, "Enter the number") %>     <%= text_field_tag :number %>         <%= label_tag(:root, "root") %>         <%= text_field_tag :root %>     <%= submit_tag("Submit") %>         <% end %>

In Lesson controller i've methods new create and soo on. I'm not sure how to use this form in another view. I have this error undefined method `lessons_path' I repeat i'm new to rails, have 2 days:))

Perhaps you have not put an entry for lessons in routes.rb.

However I suggest that you work right through a good tutorial such as railstutorial.org, (which is free to use online). That will show you the basics of Rails with much less pain than jumping in at the deep end by yourself.

Colin

Thanks, Colin.Yes, i know, i jumped in front of a train with this but must do this aplication...what must have in routes? now i have get 'lessons/add_lesson'....And another question if i what to use this form in a view created by another controller how i make the connection? Thanks for your quick answer.

In the long run you will get it done quicker if you take two days out to go through the tutorial. You cannot expect people here to lead you through every trivial aspect of building an app. For routes see the Rails Guide on Routing. To use a form in multiple views then use a partial. Again this is all covered in the tutorial.

Colin