views:

50

answers:

1

I did some stuff to have to_param return a perma-url so I'd have seo friendly links. Upon creation and update it will generate and return the perma-url in a to_param method that I put in the model. However this causing me some grief in other areas. I have a form that looks like this:

   <% @apps.each do |app| %>

   <% fields_for "[id][]", app  do |fields| %>
      ....

this fails terribly since it tries to insert the perma-url in place of the id. If I could just restrict to_param by action, that could solve things. If I change app to app.id, that fails since I have stuff like this: fields.check_box :is_featured . I suppose I could get the app instance, but that feels hacky.

Again please excuse my lack of rails-foo ;)

A: 

It is not seo friendly it is human friendly

And about problems with fields_for — try to use latest rails version and accepts_nested_attributes_for

tig
Well if it's human friendly, it's SEO friendly since it's easier to index.The situation is that I want to batch update several application objects. I know about accepts nested attributes for but I don't think it's a good idea to put that on the app object.
Stacia
You have page with form for several application objects and nothing that has_many of them?
tig
No. they're just a bunch of individual application objects that I wanted to bulk edit on one page. the previous code worked fine before I put in the permalink
Stacia