resolve/refinerycms — Issue #1247: Cannot handle String id in _form_actions.html.erb
Author: harai
Created: 2012-01-24 04:44:43+00:00
State: open

I am using RefineryCMS 1.0.9 and creating a custom engine with Mongoid.

When I selected an edit icon of the index page, I got the following error:

> SyntaxError in Admin/town_story_articles#edit
>
> Showing /var/lib/gems/1.9.1/gems/refinerycms-core-1.0.9/app/views/shared/admin/_form_actions.html.erb where line #35 raised:
>
> (eval):1: syntax error, unexpected tIDENTIFIER, expecting ')'
> admin_town_story_article_path(4f1e061c1d41c82bfa000014)
> ^
>
> Extracted source (around line #35):
>
> 32: delete_title ||= nil
> 33: delete_confirmation ||= nil
> 34: delete_button_id ||= "delete_button"
> 35: delete_url ||= eval("admin_#{f.object_name}_path(#{f.object.id})")
> 36: end
> 37:
> 38: paginate_collection = nil

The code doesn't seem to handle String id.

I copied the file to local and modified #35 like this:

```delete_url ||= eval("admin_#{f.object_name}_path(#{f.object.id.to_s.inspect})")
```

Everything works fine now.