Let me explain the subject title, store provider is Hackey, he’s a NPC
that sells items to my users.
Welcome to Hackey's!
Catalog
<%= @temp12.name %> | <%= @temp12.add_atk %> | <%= @temp12.add_def %> | <%= @temp12.sell %> |
Let me explain the subject title, store provider is Hackey, he’s a NPC
that sells items to my users.
<%= @temp12.name %> | <%= @temp12.add_atk %> | <%= @temp12.add_def %> | <%= @temp12.sell %> |
Okay 1 more q. How do I delete that row?
I’m not sure exactly whether Item.find(items.item_id) isn’t working - I
would check /logs/development.log to see what SQL is being generated.
In your code, you assign the result of Item.find to “temp12” but later
reference it as “@temp12” - these are separate variables, and you should
drop the “@” in the later references.
I’ve also got a couple more suggestions - first, you can use Item.find
to
return a collection of items, so that you don’t have to call Item.find
for
every iteration of your loop. Also, it might be easier/make more sense
to
use the rails convention of having “id” be the name of your primary
field
column, rather than “item_id”. Finally, “temp12” is a pretty
undescriptive
name, you can probably come up with a better one
Daniel
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs