Displaying 20 results from an estimated 49 matches for "image_path".
2008 Aug 01
2
image_path without timestamp
...e I use an asset tag helper, there is a parameter appended to
the end of my file name.
e.g. <input src="/images/search.gif?1213816620" type="image" />
From what I am reading, this appears to be a timestamp for caching
purposes. It works in most cases, but I want to use image_path to embed
a flash file.
.swf file in public/images/flash
e.g.
<object>.....
<param name="movie" value="<%= image_path(''flash/front_page_banner.swf'')
%>" />
....</object>
This outputs the proper path, but appends the timestamp and the f...
2011 Sep 12
0
How to get the image_path in production without the asset host?
Hi guys,
I would like to know how to get the image_path in production environment
without the asset host (using rails 3.1).
There is the image_path helper that returns the image path with md5 and (if
set, and it is set) the asset host, but we have not found a way to get the
path without the host.
Does anyone know how to do that?
Bruno Grasselli
Blog:...
2007 Dec 01
3
Rails 2 problem with compute_public_path
...k/lib/action_view/helpers/form_helper.rb:
184:in `form_for''
...
Basically, every function that calls `compute_public_path'' gets this
error. In this case, it''s ''image_tag''.
I''m looking at the source and don''t see any problem.
def image_path(source)
compute_public_path(source, ''images'')
end
def compute_public_path(source, dir, ext = nil, include_host =
true)
compute_public_path takes a minimus of one parameter, which is
supplied by image_path.
What am I doing wrong here?
Thanks,
Helzer
--~--...
2010 Jan 15
21
Dynamic Assets - can it be done?
I''m looking for 3 areas to work as dynamic assets:
image_path, javascript_path, and stylesheet_path
When I say dynamic, I mean that they will be dynamic through
controller/models. I have been working through approx. 12 hours of
searches to satisfy my answer to this question but am not finding much
luck.
The closest things I''ve found enabling this...
2006 Jul 17
2
Trouble with has_one
Hi,
I''m trying to write a blog application where each post has a single
header image associated.
My models:
----------
class Post < ActiveRecord::Base
belongs_to :blog
has_many :images
has_one :header
end
class Header < ActiveRecord::Base
file_column :image_path
end
class Image < ActiveRecord::Base
belongs_to :post
file_column :image_path
end
The controller targets I have used:
-----------------------------------
def uploadImage
Post.find(params[:id]).images.create(params[:image])
@post = Post.find(params[:id])
flash[:notice] = "...
2010 Aug 08
1
help me
...',
release_date datetime NOT NULL default ''0000-00-00 00:00:00'',
genre varchar(50) NOT NULL default '''',
created_at datetime NOT NULL default ''0000-00-00 00:00:00'',
updated_at datetime NOT NULL default ''0000-00-00 00:00:00'',
image_path varchar(255) NOT NULL default '''',
artist_id int(11) NOT NULL default ''0'',
PRIMARY KEY (id));
when i am running scaffold then it not generating albums_controller.rb file
C:\InstantRails-2.0-win_2\rails_apps\music_library>ruby script/generate
scaffold Album...
2006 Jan 09
1
Question about image storage and relative paths
...path - so,
/usr/local/rails/SomeProject/current/public/images/somefile.jpg" then
the entire setup works.
Any ideas on the best way to approach this?
In particular, a couple ways to fix this:
- Is there a method that returns the home directory of the app?
- Is there a method which complements image_path and tells me the file
system location of where a file should be saved?
- Is there a switch to force Rails to understand relative paths?
Let me know if you guys have any ideas.
Thanks in advance!
Andrew
(from Seattle, WA)
2008 Dec 04
1
upload test images using rake with populator
I am wondering if it is possible to upload test images to the database
along with the other fake user data. I am using populator along with
faker for fake test data and it is working very well. I am able to do
things like:
User.populate 100 do |user|
user.username = Faker::Name.first_name
user.email = Faker::Internet.email
end
but I am wondering if theres a way to do
2008 Oct 28
7
How to override one method of AssetTagHelper
I created a file ./lib/action_view/helpers/asset_tag_helper.rb
and put in it only the method I want to override. like this
module ActionView
module Helpers #:nodoc:
module AssetTagHelper
def image_path(source)
compute_public_path(source, ''images'')
end
end
end
end
But as soon I try this all the others methods from the overriden module
are not available anymore.
Any idea?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------...
2006 Jan 04
4
file_column
I use file_column and it works fine.
I tried to change the store_dir to a the path I want my files to be
stored and not the default.
I stored some images fine. But when I try to reach my images it seems
like file_column uses the model_name/attribute_name on the image and not
the store_dir I used. How can I change this ?
Thanks in advance
--
Alexander Antonakakis
2006 Nov 04
6
image_tag keeping add ???? after the url it generates
...e of image_tag, and couldn''t find any solution.
The ????
is appended to the "source" parameter before it goes to the real image_tag
code.
def image_tag(source, options = {})
puts source # already ????? here
options.symbolize_keys!
options[:src] = image_path(source)
options[:alt] ||= File.basename(options[:src],
''.*'').split(''.'').first.capitalize
if options[:size]
options[:width], options[:height] = options[:size].split("x")
options.delete :size
end
tag(&...
2006 Jun 28
6
file_column plugin. Storing files outside RAILS_ROOT
I also posted this on Rails Engines forum. Sorry for the double post.
I am trying to configure file_column plugin so that it stores the images
in a directory completely outside of RAILS_ROOT.
I have no problems in storing the files by setting :root_path option.
But I can''t get to display these images using ''url_for_file_column''.
What I get instead of the image is
2007 Oct 26
3
--prefix, url_for and image_tag
First time here, so I hope this isn''t a FAQ (although I did check
*the* faq).
I''m using mongrel_cluster with --prefix, and it is very slick. Thanks
for that. But I had one problem. At one point in my little app, I
have something like this:
image_tag(url_for(:action => ''picture'', :id => 1), :size =>
"160x200")
In this scenario,
2006 Mar 25
6
Where''s the doc for get(), post(), put(), delete() & head()?
These HTTP Request methods are used for testing. They are discussed in
the testing chapter of the Agile Web Development with Rails book, as
well as in http://manuals.rubyonrails.com/read/chapter/28#page72 "A
Guide to Testing the Rails".
I want to set the encoding to multipart for a test I''m writing, but I
can''t find any documentation to show me how. Pointing me
2017 Sep 18
0
[PATCH v9 4/7] builder: add Index.write_entry function
...tring.concat "," (formatter x))) ^ ")"
+ ) in
+ assert_equal ~printer
+
+let test_write_complete ctx =
+ let entry =
+ ("test-id", { Index.printable_name = Some "test_name";
+ osinfo = Some "osinfo_data";
+ file_uri = "image_path";
+ arch = "test_arch";
+ signature_uri = None;
+ checksums = Some [Checksums.SHA512 "512checksum"];
+ revision = Utils.Rev_int 42;
+ format = Some "qcow2";
+ size = Int64.of_int 123456;
+ compr...
2017 Oct 27
0
[PATCH v11 6/8] builder: add Index.write_entry function
...tring.concat "," (formatter x))) ^ ")"
+ ) in
+ assert_equal ~printer
+
+let test_write_complete ctx =
+ let entry =
+ ("test-id", { Index.printable_name = Some "test_name";
+ osinfo = Some "osinfo_data";
+ file_uri = "image_path";
+ arch = "test_arch";
+ signature_uri = None;
+ checksums = Some [Checksums.SHA512 "512checksum"];
+ revision = Utils.Rev_int 42;
+ format = Some "qcow2";
+ size = Int64.of_int 123456;
+ compr...
2017 Oct 05
0
[PATCH v11 4/6] builder: add Index.write_entry function
...tring.concat "," (formatter x))) ^ ")"
+ ) in
+ assert_equal ~printer
+
+let test_write_complete ctx =
+ let entry =
+ ("test-id", { Index.printable_name = Some "test_name";
+ osinfo = Some "osinfo_data";
+ file_uri = "image_path";
+ arch = "test_arch";
+ signature_uri = None;
+ checksums = Some [Checksums.SHA512 "512checksum"];
+ revision = Utils.Rev_int 42;
+ format = Some "qcow2";
+ size = Int64.of_int 123456;
+ compr...
2006 Aug 18
11
#<Errno::EMFILE: Too many open files
My application runs a backgrond process and after running for a while I
get this error in my logs:
#<Errno::EMFILE: Too many open files
Lasty, the ONLY code I have that does anything with files is:
File.open(image_path, "wb") do |file|
file.puts file_content
end
Any idea what this means?
--
Posted via http://www.ruby-forum.com/.
2018 Feb 22
11
[PATCH 0/5] v2v: Add -o rhv-upload output mode.
The first four patches are straightforward.
The final patch adds the -o rhv-upload output mode. It is
still spooling into a temporary file because I've had some
trouble getting streaming conversions working. There are
other problems as outlined in the commit message, so this
patch is not ready for upstream but is good for discussion.
Also I hit this, which I'm assuming for now will be
2018 Mar 25
0
Re: [PATCH v7 6/6] v2v: Add -o rhv-upload output mode (RHBZ#1557273).
...ot;format"] == "qcow2":
> disk_format = types.DiskFormat.COW
> else:
> disk_format = types.DiskFormat.RAW
>
> disks_service = connection.system_service().disks_service()
> disk = disks_service.add(
> disk=types.Disk(
> name=os.path.basename(image_path),
> description='Uploaded disk',
> format=disk_format,
> initial_size=image_size,
> provisioned_size=image_info["virtual-size"],
> sparse=disk_format == types.DiskFormat.COW,
> storage_domains=[
> typ...