Hi Tim,

It seems like Hobo is ignoring your default url options.

Please try this workaround, I think it should help:


* Clone the Hobo repository
* Point your Gemfile to the cloned folder: gem 'hobo', path: '/my/path/hobo'
* Edit hobo/app/helpers/hobo_route_helper.rb:72, and replace the 
"polymorphic_path" call with this:
        params[:host] = "mydomain.com"
        base_url = url = polymorphic_url(poly, params)
* Run bundle, and restart your app


If it works, maybe you can try to implement some logic to look for the 
existence of default_url_options[:host]. I made a quick try but it looks 
like "default_url_options" was not available.

Warm regards,
Ignacio




On Friday, June 3, 2016 at 1:20:11 AM UTC+2, Tim Griffin wrote:
>
> Hi all;
>
> Anyone have any bright insight in how to get Hobo-generated ajax routes to 
> include the host (and port)? 
>
> I have this definition:
>
> <form 
> with="&new_for_current_user(this.document_attachments)" 
> owner="document" 
> message="Uploading..." 
> updates="#attachments-div,#document-requirements-div" 
> without-cancel>
>
> for which Hobo generates a relative path for the action:
>
> <form action="*/documents/4228/document_attachments*"...
>
> and I really need this:
>
> <form action="*https://server.com/lts <https://server.com/lts>*
> /documents/4228/document_attachments"...
>
> I already have default_url_options set in my ApplicationController:
>
>   def default_url_options(options={})
>       case Rails.env.to_sym
>       when :development
>         { :host => 'localhost', :port => request.port }
>       when :test
>         { :host => 'localhost', :port => request.port }
>       when :staging
>         {:host => "testserver.com"}
>       when :production
>         {:host => "server.com"}
>       end
>
> but, my guess is that this is not consulted when Hobo generates an ajax 
> route. 
>
> Hobo generates relative routes for all of its ajax links that it 
> creates... so, anything I can do? 
>
> If I wasn't being asked to host this app in a sub-directory, I wouldn't 
> worry about it, but....
>
> Many thanks,
> Tim
>
>

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to