search for: asset_path

Displaying 15 results from an estimated 15 matches for "asset_path".

Did you mean: assets_path
2012 Oct 18
#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 core though. -- You received this message because you are subscr...
2011 Jul 22
Asset Pipeline and Sprockets
Ok I would love to work out how to use the new Raisl 3.1 Asset Pipeline with SCSS variables, mixins etc and being able to use the asset_path tag. What I have so far is this. Im my application.css.scss I have the following. *= require_self *= require layout *= require home This works fine with using the asset_path helper and variable within layout ie, // layout.css.scss.erb $main-color: #cccccc; .s...
2010 Jun 11
AR after_initialize quandry
...r. I see several threads on people trying to use after_initialize, but no conclusive answers to the same errors I am seeing -- undefined method `stringify_keys! Example refc: My after_initialize is just this simple code: def after_initialize(asset_path) @asset_path = asset_path end So either a) what is the proper technique for using after_initialize, or b) is there another way I can pass params to an AR model in a .new call ? Thx. -- greg willits -- Posted via -- You received this message because yo...
2006 May 30
Modules in the ''lib'' directory
Hi, I have a module in the /myApp/lib directory to help manage image files. It is coincidentally called ''image_manager''. There is a function in there called asset_path, which is used to determine the path of the images that is defined as follows: def asset_path "#{RAILS_ROOT}/#{ASSET_DIR}/#{}" end I am including the image manager module in the model for the image, but when I call this function I get the following error: undefine...
2012 Sep 28
Overriding class_attribute writers and order of super/extend C.M./included block eval in ActiveSupport::Concern
...k) if instance_variable_defined?("@_included_block") And there are classes like this that only benefit from the dependency handling and included block class_eval part of Concern that maybe could benefit from that being split up somehow?: actionpack/lib/abstract_controller/asset_paths.rb: module AbstractController module AssetPaths #:nodoc: extend ActiveSupport::Concern included do config_accessor :asset_host, :asset_path, :assets_dir, :javascripts_dir, :stylesheets_dir, :default_asset_host_protocol, :relative_url_root end end end Sorry if this...
2008 Jun 02
stylesheet_link_tag, javascript_include_tag, caching problems
...when the files already exist ... even if I''ve changed my list of js/css files to something completely different, it won''t rewrite the file if it already exists ... Do we really need the unless in this block? (asset_tag_helper.rb) def write_asset_file_contents(joined_asset_path, asset_paths) unless file_exist?(joined_asset_path) FileUtils.mkdir_p(File.dirname(joined_asset_path)), "w+") { |cache| cache.write(join_asset_file_contents(asset_paths)) } end end --~--~---------~--~----~----...
2011 Sep 23
Rails 3.1.0 how to pass the full url of an image asset ?
...eed to reference the full url of an image stored in the assets, this url is passed to fancy box to open it I build the image path in helper and it get the path "ceramics/big/c0d0.jpg" "ceramics/big/c0d2.jpg", ... but I need to get the full url to these image asset_path("ceramiques/big/c0d0.jpg") => "/assets/ceramiques/big/ c0d0.jpg" but there is no asset_url to get http://localhost:3000/assets/ceramiques/big/c0d0.jpg or
2012 Jan 03
Rails 3.1 assets pipeline issue in production
.... I put it in assets/javascripts/jwplayer/ova-jw.swf I did it because the player.swf is also in the same folder , and running fine , the clip is playing... the urls are generated , in partial _fw_player.js.erb , using ''flashplayer'': "<%= escape_javascript( asset_path(''jwplayer/ player.swf'')) -%>", and ''plugins'': { "<%= escape_javascript( asset_path(''jwplayer/ova-jw.swf'')) -%>": { is it wrong ? how and where should I store these 2 files to avoid being compiled in Product...
2006 Jul 15
Relationship problem, newbie problem, need help!!
...= shops.style_id where shop_uri = '''' Cheers!! Tim Perrett PS: The tables are the following... #---------------------------- # Table structure for styles #---------------------------- CREATE TABLE `styles` ( `id` int(11) NOT NULL auto_increment, `css_file` text, `asset_path` text, PRIMARY KEY (`id`), KEY `id` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; #---------------------------- # Table structure for shops #---------------------------- CREATE TABLE `shops` ( `id` int(11) NOT NULL auto_increment, `affiliate_id` int(11) default NULL, `shop_configurtaio...
2009 Sep 15
Liquid assign_to
Hello using liquid markup i am trying to do the following. {{ ''holiday'' | album_thumbs | assign_to ''asset_list'' }} {% for asset in asset_list %} "link: " + {{ asset | asset_path }} {% endfor %} It should return a list with all assets for the loop, but the asset_list variable never gets set. It just returns #### (number of records) on this line: {{ ''holiday'' | album_thumbs | assign_to ''asset_list'' }} I have created the following funct...
2011 Sep 27
Rails 3.1 assets path for video player Flash script 'player.swf'
I was using a Flash video player within a previous Rails version app Moving to Rails 3.1.0 , I dob''t know where I should put the script ... I tried to move it into an app asset sub-directory assets - jwplayer - - player.swf but this raises an error "NetworkError: 406 Not Acceptable - http://localhost:3000/assets/jwplayer/player.swf" player.swf the flash
2011 Oct 25
Sprocket Digest + Debug combination broken?
...ets/index.rb:48:in `find_asset'' sprockets (2.0.3) lib/sprockets/base.rb:110:in `[]'' actionpack (3.1.1) lib/sprockets/helpers/rails_helper.rb:141:in `digest_for'' actionpack (3.1.1) lib/sprockets/helpers/rails_helper.rb:154:in `rewrite_asset_path'' actionpack (3.1.1) lib/action_view/asset_paths.rb:27:in `compute_public_path'' actionpack (3.1.1) lib/action_view/helpers/asset_tag_helpers/asset_include_tag.rb:64:in `path_to_asset'' actionpack (3.1.1) lib/action_view/helpers/asset...
2013 Mar 10
css url paths when moving it to a different folder
Hey. Its simple quation, but have litle problem with this. Its my path for css - assets/content/stylsheets/my.css Its path picture for background url - assets/images/picture.gif I do the following in my.css background: transparent url(../../images/picture.gif). but the path is not correct, the image is not found. I tried with one ../ and easy
2008 Mar 12
nested routes with a 2-way has_many using join table?
I have two classes, InstructionalObject and Assets. They both have_many of the other, implemented through a join table (so it''s like a habtm without the habtm). For the next version of our app, we''re refactoring to RESTful, and i''m having trouble with my nested resources/routes. I tried this, in routes.rb: map.resources :assets do |assets| assets.resources
2007 May 26
Hi RSpec Mailing list, I''m new to RSpec and I am trying to get it running with the sample rails app. I installed the current version of rspec with rspec_on_rails I tried to run rake spec but received: 330-07:~/desktop/restful_auth_rspec/vendor multimedia$ rake spec (in /Users/multimedia/Desktop/restful_auth_rspec)