i have a database setup with an id and a field called uniquename
say for example my db looks like this:
id | uniquename |
1 | pizza |
2 | salad |
at the moment the routing works as follows:
instead i’d like it to route from:
any ideas?
i have a database setup with an id and a field called uniquename
say for example my db looks like this:
id | uniquename |
1 | pizza |
2 | salad |
at the moment the routing works as follows:
instead i’d like it to route from:
any ideas?
Andrew Kendall wrote:
i have a database setup with an id and a field called uniquename
say for example my db looks like this:
id uniquename 1 pizza 2 salad at the moment the routing works as follows:
instead i’d like it to route from:
any ideas?
You can do this as-is. Just use the params[:id] differently. i.e.,
search for it in the database:
item = Items.find_by_uniquename(params[:id])
I’m a newbie answering a question, so take this with a grain of salt.
Jake
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