Displaying 20 results from an estimated 3000 matches similar to: "url_for_file_column and image_tag not working right together"
2006 Jul 02
1
url_for_file_column not working
Hi All
I am able to upload images but when I add the code to my view.rhtml
<%= image_tag url_for_file_column("myimage", "image1", "medium" ) %>
I dont get the image displayed; the reason being some extra numbers are
added to the image file name.
For example when I loaded intro_image.jpeg; it has the right file name
in the database table.
When I check the
2005 Oct 09
6
Problem With url_for_file_column/file_column
I am using the very helpful file_column extension in my app.
The uploading portion works great - no problems.
Where I am having an issue is displaying the images in my view. My code
looks like this:
<% for @record in @main_box_releases -%>
<%= image_tag(url_for_file_column("record", "record_cover")) %>
<% end -%
@record is an instance of a class called
2006 May 06
0
file_column, image_tag, absolute paths?
The docs in the SVN version of file_column state that url_for_file_column
will return paths relative to the application root, and that if I pass it
to image_tag, I''ll get an absolute URL.
This doesn''t appear to be the case, at least with Rails 1.1. image_tag
returns the same app-root-based path that it''s given.
Doc bug? Rails change? file_column bug?
Jay Levitt
2006 Jan 08
0
link_to_remote(image_url url_for_file_column(product, "image
I apologise for bad formatting. I don''t know how to make it nice in an
email
How do you nest image_url tags into link_to_remote tags. The following
creates the error:wrong number of arguments (3 for 2)
<%= link_to_remote(image_tag url_for_file_column(product, "image_url"),
{ "class" => "small_product",
2006 Jan 25
1
url_for_file_column in parent model''s view
Hi All,
I am using the file_column plugin to upload images. The model that I
am using is simply called images (id, name, caption - name being the
"file" column) and it belongs_to a parent model called books which
has_many images. I was able to figure out how to enter the images
into the correct model when updating of form of the parent model
(books). Now I need to figure out
2008 Sep 15
1
url_for_file_column within if within a partial
I have a partial that has the following code:
<% if product.prd_big_image.nil? %>
<img alt="Image" src="/images/empty.jpg">
<% else %>
<%= image_tag url_for_file_column(:product, :prd_big_image,
"normal") %>
<% end %>
and get the following error
You have a nil object when you didn''t expect it!
The error occurred while
2006 Jan 11
1
fiile_column persistent across different forms
is there a way to keep the file_column field in the form persistent
across diffferent view templates ?
In my controller (same controller for both views) i do
@post = Post.new
in the view i do
form_step1.rhtml
---------------------
<%= file_column_field "post", "image" %>
<% if @post["image"] %>
<%= image_tag url_for_file_column("post",
2006 Jan 17
2
file_column plugin and instance variables
To make file_column work I have to copy my local variable back to an
instance variables like this:
<% for product in @products
@product = product %>
<div class="catalogentry">
<%= image_tag url_for_file_column(''product'', ''image_url'') %></p>
This is needed because file_column specifically looks for the instance
2006 Jan 19
1
partials and instance variables for file_column
Hi,
Sebastian Kanthak of the file_column-Plugin wrote once:
"is the photo object inside a local variable or an instance variable
(e.g. photo or @photo)? url_for_file_column only works with instance
variables, like all other active record form helpers. Could this be
the problem?"
So I''m using file_column in a partial, e.g.
<%= render (:partial => "product",
2006 Mar 02
2
url_for_file_column not returning correct path
I added this test towards the end of the included
file_column_helper_test.rb that shipped with the file_column plugin:
def test_url_for_file_column_different_root_path
Entry.file_column :image, :root_path => File.join(RAILS_ROOT,
"public/files")
e = Entry.new(:image => upload(f("skanthak.png")))
assert_match %r{/public/files/entry/image},
2006 Apr 22
0
Re: Rails Digest, Vol 19, Issue 611
Thanks szymek for putting me on track. What I did was re-intstall the
file_column plug-in but I still got the same error so I added @recipe =
recipe and then then error changed to something about nil.first. So I added
a
rescue "no image"
to the end of my image_tag like so
<%= image_tag url_for_file_column("recipe", "image") rescue "none" %>
and
2006 May 08
1
file_column - url_for_file_column issue.
Hi,
url_for_file_column @variable, ''name'', takes an instance variable. My
question is, what if I don''t want to have to retrieve the instance variable
every single time but I have the image id, along with its name with me.
Could I contruct that object in a view and pass it to url_for_file_column:
<% @picture = Picture.new %>
@picture.id = ...
2006 Jan 17
5
file_column mangling URL
Hey,
I''ve gotten file_column to upload a file, drop it in the dynamic
directory, but I can''t display the image, the directories repeat
themselves:
My model:
class Person < ActiveRecord::Base
file_column :image_url
In my view:
<%= image_tag url_for_file_column(''person'', ''image_url'') %>
HTML generated is this:
<img
2006 Feb 10
2
file column within link_to
Hi,
I correctly see:
image_tag url_for_file_column("element", "picture_url", "medium")
now I need to make it a link so I''ve used:
<%= link_to(image_tag url_for_file_column("element", "picture_url",
"medium"), {:controller => "products", :action => "sec_level",
:level_id => @element.id}) unless
2007 Dec 29
1
url_for_file_column not works
I am using the file column plugin.
If i upload an image it works correctly but if i want to show an image
it not works.
in my template i insert
url_for_file_column(@core, "image", "thumb")
but return ""
i tried to print @core.image but it is set to nil.
My model is this:
class Core < ActiveRecord::Base
has_one :forum_topic
has_many :votes
has_many
2005 Dec 17
1
file_column url_for_file_column from within controler
Hello,
i hope somebody can help me:
How can i get the path/url for a file stored with file_column within any
contoller?
Is it somehow possible to use the url_for_file_column method from the
file_column_helper.rb ?
Greetings and thanx for any advise,
Marc
--
Posted via http://www.ruby-forum.com/.
2010 Mar 20
0
Problem with videos on heroku
Hi,
I have recently moved my RoR app on the Heroku platform, and almost
everything works fine apart from the videos. It works fine when my app
runs in local but not on heroku. This is the error log I''m getting, if
anyone knows where it can be coming from:
Processing VideosController#new (for IP at 2010-03-20 04:32:09) [GET]
Session ID: 6abecf60c3369d7c7029e366bb801e08
Parameters:
2006 Jul 13
0
file_column
Hello all, another rails newbie here.
I''m working on an project to simply upload pictures with some extra
information, I was able to get uploads working thanks to file_column,
however, a couple things are troubling me. First of all, according to
the file_column website, displaying images should go like this:
<%= image_tag url_for_file_column("entry", "image")
2006 May 12
11
Stupid? question about if else logic
this seems so stupid, I keep thinking I''ve dealt with this before but I
have this code
<h1>Portraits</h1>
<% if @image.portrait == 1 %>
<%= image_tag(url_for_file_column ''image'', ''file'', ''thumb'') %>
<% else %>
<h1>Landscapes</h1>
<%= image_tag(url_for_file_column
2006 Apr 22
1
using file_column
I''m trying out this recipe from the Rails Recipes book (the tagging one) but
I''m also trying to use file_column to handle the uploading of pictures.
Basically I think the problem is I''m not using an instance variable in the
view''s partial that shows the details of my item. Off of my original
list.rhtml page I have a
<%= render :partial =>