Displaying 20 results from an estimated 49 matches for "asset_host".
2008 Mar 20
2
Anyone having problems with asset_host not getting set up right?
Hey All,
I think I found a bug but I would be suprised since it would cause major
problems.
We setup the asset_host in init.rb with:
if File.exist?(facebook_config)
FACEBOOKER = YAML.load_file(facebook_config)[RAILS_ENV]
ENV[''FACEBOOK_API_KEY''] = FACEBOOKER[''api_key'']
ENV[''FACEBOOK_SECRET_KEY''] = FACEBOOKER[''secret_key'']
ENV['...
2011 Sep 02
1
can't compile assets on prod due to asset_host config && SSL requirement
My production asset_host config looks like this:
config.action_controller.asset_host = Proc.new { |source, request|
if request.ssl?
"#{request.protocol}#{request.host_with_port}"
else
"#{request.protocol}assets#{(source.length % 4) +
1}.example.com"
end
}
...which is more...
2008 Jun 28
5
asset_host?
...ROR app directly I noticed that all requests for images, CSS, and JS files were being made through my callback_url. Commenting out the following line from Facebooker''s init.rb made this stop, but I''m not sure what else I might be breaking with this change:
ActionController::Base.asset_host = FACEBOOKER[''callback_url''] if(ActionController::Base.asset_host.blank?)
Any pointers?
----
We must be careful about what we pretend to be. - Kurt Vonnegut
2010 Aug 05
5
asset_host and ActionMailer
After digging through the rails code to figure out why my asset_host
wasn''t getting applied to emails, I realized that it''s because the
config object in the context of a mailer is config.action_mailer and
not config.action_controller. This means you need to set asset host
separately for emails, as config.action_mailer.asset_host.
Should this be co...
2008 Jan 31
3
Using facebooker AND Haml/Sass
For anyone using both and encountering trouble with stylesheets
(specifically, the paths being incorrect in production mode)...
Removing facebooker solves the issue.
But I bet you don''t want to do that, eh? So, simply setting
ActionController::Base.asset_host = ''''
also works like butter.
I''m not 100% clear on why asset_host has anything to do with
facebooker, or if people will in other cases NEED to use it, but this
solved it for me. After reading the discussion on this list, I''m still
a bit confused about the...
2008 Jun 13
1
asset_host and ssl pages problem
...ttps:// rather than http:/ but i do not have https
configured on the assets server. I have dug around a bit and found this
bit of code which should when a page is https:// serve the assests from
the app server and when it is not https serve the assets from the assets
server.
ActionController::Base.asset_host = Proc.new { |source, request|
if request.ssl?
"#{request.protocol}#{request.host_with_port}" # Disable asset
hosting.
else
"#{request.protocol}assets1.example.com" # Use asset host.
end
}
but i always get this error when navigating to any page
Showing layouts/ad...
2009 Sep 26
0
Paperclip with external url and asset_host?
Hi,
I''m trying to get Paperclip to work with asset_host and have totally
failed to do so.
The idea is to use asset_host to specify the url that I want to use for
my image hosting (www.unlimitedwebhosting.co.uk) so that link helpers
will use the image host location instead of the local file system.
This works really well and in truth I''m total...
2006 Aug 15
0
Using config.action_controller.asset_host with ActionController::AbstractRequest.relative_url_root
I''m looking for some help with an issue I''m having using an external
asset host. I''ve got the lines below in my environments/development.rb
file.
# Enable serving of images, stylesheets, and javascripts from an asset server
config.action_controller.asset_host = "http://assets.example.com"
#make rails think it lives in /app
ActionController::AbstractRequest.relative_url_root = "/app"
When I then include the this code in my layouts:
<%= stylesheet_link_tag ''main'' %>
<%= javascript_include_tag :defaults %>...
2007 Dec 16
0
Specifying asset hosts via a proc (ActionController::Base.asset_host)
Hi all,
I just submitted a patch that would allow you to pass a proc to
ActionController::Base.asset_host rather than just using a %d
wildcard (e.g. assets%d.example.com). Basically this frees you from
the hard-coded assumption that you have 4 hosts numbered 0-3 and also
allows you to do smarter things depending on the asset (e.g. images
from a particular domain, stylesheets from another). The motivat...
2009 Oct 01
0
Paperclip + asset_host uploading to external URL
I would need to be able to upload images to an external URL
I know S3 is an option but there are better image hosts out there for my
requirements and one in particular I would like to make use of.
I''m thinking that I could use asset_host to determine the url and path
but I can''t seem to make Paperclip play nicely.
The image host I want to use is www.unlimitedwebhosting.co.uk
I have the accounts all set up and I have SSL enabled I just need to
know how I can set a url and path to a paperclip attachment to get it to
upload...
2012 Oct 18
3
#asset_url helper method
Just putting this out there before I make a pull request.
Is there any interest in an asset_url method as a view helper?
It would work by using the config.action_controller.asset_host if it exists
and prepending this to the results of asset_path.
I have found this necessary when writing html emails and needing a full url
path for assets. Since my CDN in the asset_host mirrors my assets in my
app it makes perfect sense. Might not be a common enough use case to put
into cor...
2008 Mar 10
15
facebooker is rewriting URLs even off of facebook canvas
The URLs for CSS/JS files are being rewritten to the address specified
in the tunnel even when outside of the facebook canvas. Is anyone else
having this problem?
2009 Mar 13
7
rails, passenger, and images
Just switched over to passenger for development and production for my
rails app. Liking it so far.
My problem is my image_links, stylesheet_tag_links, and
javascript_tag_links are all adding "http://localhost:3000 to the
generated links. I got around the stylesheet and js links by not using
the helpers.
I can access my all of my assets directly via http://dating.local/stylesheets/all.css,
2008 Jan 26
14
Introducing facebooker.yml
If you are using facebooker as a plugin, you can now have all your
configuration in one place, namely config/facebooker.yml. You can
create this file with rake facebooker:setup. It is also generated
when you install it as a plugin.
It has a similar setup to database.yml with sections for each
environment. You can also configure your ssh reverse tunnels.
If you are upgrading, make sure to
2008 Mar 24
2
link_to_remote and restful routes/urls
...9;s new
link_to_remote helper?
something like:
<%= link_to_remote h(user.name),
:update => "div_id",
:url => user_url(user) %>
of course, that doesn''t work.
i have also been trying things like:
:url => controller.asset_host + "/users/#{user.id}?method=get" %>
to no avail.
2006 Sep 21
5
Static files in public
My question is about the static files in the Rails public folder. These
files should be served by Apache instead of Mongrel, so do I need to
upload these files to Apache''s htdoc''s or will Apache cache them the
first time they are requested from Mongrel... Im not sure how this works?
Many thanks.
2008 Dec 10
12
image_tag cannot show picture
Dear all
I am new to rails.
In view, I place the following code, but cannot show the picture in the
webpage
<%= image_tag("green.JPG") %>
However, I can access the picture in this url
http://localhost:3000/images/green.JPG
The HTML source code generated
<img alt="Green" src="/images/green.JPG.?1228211220" />
I cannot identify the problem. Please help
2009 Apr 06
2
URL issue localhost/mongrel vs remote-server/apache
...nderstand..)
I am testing an app on my remote_server (w Apache/Passenger) in a
sub_URI, without any problem (I tested also the same app, locally w
Apache too)
in my environment.rb , I have initialized
config.action_controller.relative_url_root = "/my_subURI"
config.action_controller.asset_host = "http://my_domain.com
...
running fine. I am also using a facebox plugin, in which 2 images :
loading.gif and closelabel.gif are hard-coded (I know it should not
be.. but I am not the author..), so in the facebox.js , I had to
modify the hard-coded URI
$.extend($.facebox, {
settings: {...
2009 Jul 20
1
CSS issue when using SubUri and Passenger
I am testing another application in local
in my environment.rb I wrote
config.action_controller.relative_url_root = "/elnino"
config.action_controller.asset_host = "http://opticoaching.local"
I defined correctly the vhost (I have already odne it for another app
which is running well...)
<VirtualHost *:80>
ServerName opticoaching.local
DocumentRoot "/Users/yves/Sites/rails/opticoaching"
RailsEnv development
RailsDefau...
2006 Jan 04
1
[BUG?] image_tag
...; unless source.first == "/" || source.include?(":")
source = "#{source}.#{ext}" unless source.include?(".")
source = "#{@controller.request.relative_url_root}#{source}" unless %r{^[-a-z]+://} =~ source
source = ActionController::Base.asset_host + source unless source.include?(":")
source
end
can this be correct? in this line
source = "#{@controller.request.relative_url_root}#{source}" unless %r{^[-a-z]+://} =~ source
we''ll take the url
/foo/bar.jpg
and prepend /foo onto it again, even thoug...