basically, hobo_new creates a new model and passes it off to view
unless it's a redirect from failed validation in which case, it pulls
in the info from the parameters.  you could pass an id as a parameter
and add a check for it
def new
  if param[:id]
    original = ModelClass.find_by_id param[:id]
    this = @modelclass = original.clone
  else
    your original code
  end
end

I'm sure there's a cleaner way to do it but that should work.

On Mar 25, 6:17 pm, Daniel M <[email protected]> wrote:
> Hi all.
>
> I have one controller with ajax request like its described on the
> recipe -http://cookbook.hobocentral.net/recipes/15-dynamically-
> populated-select-menus
>
> def new
>   hobo_new do
>     this.attributes = params[:project] || {}
>     hobo_ajax_response if request.xhr?
>   end
> end
>
> It´s working ok, but now I will need do send pre-filled data to new
> form from other record. For example how i can create a new page with
> the project name already filled?
>
> The ideia  is to find another project and fill the new form with
> exactly the same data except the city..for example.
>
> Thanks in advance.
>
> Regards.

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to