views:

14

answers:

1

In a Rails3 app, I want to use resourceful paths for an ActiveModel EntityImage representing image file uploads. In some directory I have these files dir/#{type}/#{id}/#{size}.jpg (which are basically all important fields of that class)

Now, probably, because 'id' is a bad name rails wise (it is not domain wise), when I want to make a delete button, I get a form pointing to:

<form class="button_to" action="/entity_images/test2" method="post">
<div>
<input type="hidden" value="delete" name="_method"/>
<input type="submit" value="Excluir" data-confirm="Certeza?"/>
<input type="hidden" value="4SWGCEfvdrWrj7xBBtlT0CR4EHPzXQaCFWF0/blmKCk=" name="authenticity_token"/>
</div>
</form>

Of course, with this info, I cannot get to my image, I still need to know the type of the entity and the size. How could I make the path helpers do the right thing? Or any other idea, suggestion?

A: 

Ok, so I joined the id property from (now) name, type and size and can split that and reconstruct these values

Jan Limpens