ruby on rails - Many to many associations -


Hello There is a hard time debugging my code What do I need to do to create a page where users last Type the name and the system will return the related information about it. I am stuck and can not debug it or any guidance or guidance will be appreciated

Model of my customer table

  class customer & lt; ActiveRecord :: Base has has_many: Booking is has_many: cell ,: through: = & gt; : Booking def mail_list "# {first} - # {last} - # {mary}}" and end   

This is the page that the user should display after entering the last name

  & lt; Center & gt; & Lt; Table width = 65% range = 1> & Lt; TR & gt; & Lt; Th & gt; Customer's name & lt; / Th & gt; & Lt; Th & gt; Cell number & lt; / Th & gt; & Lt; Th & gt; Cost & lt; / Th & gt; & Lt; / Tr & gt; & Lt;% @ customers_list.each do | M & Gt%; & lt;% p = m.cost% & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt;% = m.name% & gt; & Lt; / TD & gt; & Lt; TD & gt; & lt;% = m.roomnumber% & gt; & Lt; / TD & gt; & Lt; TD & gt; & Lt;% = m.cost% & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt;% end% & gt; & Lt; / Table & gt; & Lt; / center & gt; & Lt; Br / & gt; & Lt; Br / & gt;   

Here is the page that takes the last name

   "bookin" ,: Verb = & gt; "bookout" ,: method = & gt; "post")% & gt; & Lt; Div class = "field" & gt; & lt;% = label_tag: customer_name% & gt; & Lt; Br / & gt; & Lt;% = text_field_tag: customer_name_in% & gt; & Lt; / Div & gt; & Lt; Div class = "verb" & gt; & Lt;% = submit_tag "Submit Customer Name"% & gt; & Lt; / Div & gt; & Lt;% end% & gt;   

The model of my rates table

  class rate & lt; ActiveRecord :: Base is valid: Season, room,: Cost, Attendance: True_Image: Booking is_Maya: Room ,: By & gt; : End of booking   

Here is the controller of my bookies who give last name to the user and post the results

  Class BookinController & lt; ApplicationController def bookin def bookout @customer_name = params [: customer_name_in] r = customer.find_b_ last (@customer_name) @room_list = r.rooms end end   

Here is the model of my room table Class Room & lt; ActiveRecord :: Base has has_many: Booking is has_many: Customer ,: By: = & gt; : End of booking

This is the model of my booking table

  related_to: room related_to: customer believes: rate expiration   

This is my route

  Hotels :: application.routes.draw do resources: Booking "Bookin / Bookout" post "Get Bukini / Bookout" list / list Out "Get the Resource: Get the" Menin / Outout "Resource: Consumers receive" Shone / Showout "resource Receive "RETIN" / Retouch "Get Foodin / Food" Resources: Apple Resources: Room Resources: Menu Resources: Rates "Starter / Home" Resources: Foods "Bucin / Book Name" Post "Bukin / Book name "root" starter #home 'end    

You multicolored model name is is_im I have to do with , use it

  has_many: bookings has_many: rooms ,: through = = & gt; : Booking   

You have not followed the rail on the names of your models and controllers

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -