Ruby On Rails and more...
Wednesday, 21 October 2015
creating instance based on model name :
var_name = Admin:
:
User
.
model_name
.
param_key
# var_name is admin_user
to
make admin_user as
instance variable
:
instance_variable_set
(
"@#
{
var_name}", Admin:
:
User
.
last)
now
,
@admin_user give you a last record of Admin:
:
User model.
wow
...........
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment