I’m a noob trying to learn 2.0 via the AWDR 1.2 book. What I’m doing
is the depot app and I’m trying to follow the admin/store controller
way. So right now I have a Product model and I ditched the
products_controller and views for an admin_controller and views.
I’m getting tripped up on the “edit” link on the product index page
view. So if I were using the standard scaffold created by 2.0 my edit
link in index would like this:
<%= link_to ‘Edit’, edit_product_path(product) %>
And that would link to http://localhost/5/edit (assuming we’re
clicking product id of 5)
But that is when there’s a products_controller. However, I have an
admin_controller. What would my link_to look like for that to work
correctly? Everything I try gives me a undefined method error telling
me to stringify_keys! And after doing some research it’s because I’m
sending a string value when it expects a hash. And my url string is a
bit different: http://localhost/edit/5 instead of
http://localhost/5/edit.
I’m lost
Thanks.