Vince W. wrote:
My layout calls a few links like so:
<%= link_to '| Home ', :controller => ‘search’, :action => ‘’%>
<%= link_to '| Search ', :controller => ‘search’, :action => ‘’%>
I would also like to display two values from my user table in the same
layout right after the search: the contents of the name field, and the
contents of a integer field called tokens.
Can somebody please guide me or start me off in the correct direction
I hihgly recommend you try some tutorials to get familiar with the rails
basics. Try some of the links here:
But in answer to your question, you retrieve database rows as
ActiveRecord object in your controller, then access the created
variables in your view.
class UsersController < ApplicationController
@user = User.find(1) #find user with an id of “1”
Greetings <%= @user.name %>!