Reputation: 2570
I'm trying to pass an object through a form like this:
<%= simple_form_for :export, url: export_path(format: :xls,data: @result) do |f| %>
### fields
<% end %>
But I'm getting the object as a string and so I'm not able to access it. How do I convert the passed string to object?
I'm getting:
undefined method
something
for "Mongoid::Criteria:0x00000105f75818":String
Update
I found out that this is a really bad way of passing object via a form. Instead, I sent all the id
's concerning the @result
object and recreated the result
object server side. That solved my problem.
Upvotes: 2
Views: 74
Reputation: 22926
There are few options for you:
Upvotes: 4