How can I get data from an array of the form:
[#<User id: 1, name: "John", surname: "Smith", dob: "2016-07-26", location: "Liverpool", created_at: "2016-07-26 08:50:01", updated_at: "2016-07-26 08:50:01">]
generated from sqlite3 database using this code:
<%= User.select(User.all.select { |u| u.id == 1 }) %>
Also, is there any better way to extract selected fields than everything? Whatever I tried returns some long random numbers like references.
And finally, how can I make the:
u.id == 1
to become any id given to that user in real time, like the following:
u.id == x (where x is any number)
Cheers!
pluckUser.last.nameif the you want to show the name right after registration (though it is not safe if two people register at the same time. Another way is to pass the registered user as an instance variable. Surely you have a controller method where you have@user.saveor something similar. So then just display '@user.name` in your view