Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. CONerian, thanks for those links. I have read them all...many times. I understand the function of routes and I understand what the controller does. I have also looked through the scaffold and it did give me some insight into the way it functions - e.g. it automatically generates 6 actions, and in each action it shows me how to do what that action does e.g. index: `@users = User.all`, etc. However, my main issue is how to get it to do what I want. Do you mind just using the bank transaction example to explain it ? Thanks.
      singulars
    2. COAs in...just to be clear: I understand why the scaffold generated what it did to do what the Rails Core team wants the scaffold to do. However, I don't understand (in intimate details) how to get the controller to do what I need it to do. If I want to show the customer their account balance, how would I do that and why would I do that? Would I use variables in the controller? What would I have in the view? Etc. I hope I am explaining it clearly.
      singulars
    3. CO@marcamillion: Sure. Take a look a the Index action. You will se that it makes a call Post.all – That query the database, through the Post model – and store the result in a @variable. Every variable that you define as @ will be passed to the view. In the view you will have a mix of HTML and Ruby code. Ruby code is between <% %> and <%= > . The difference is that <%= %> will output the result. For example <%= Product.name %> output the name. <% Product.name %> will not. Take a look a the Index view. Ask me anything you don't understand.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload