Displaying 20 results from an estimated 12000 matches similar to: "Named link to image"
2006 May 23
3
image_tag problem
Hiall,
I want to make an image_tag from within a controller in order to be
able to present a link (with a status image) in a view. Here is my
controller method (in file webca_controller.rb, hence WebcaController)
def untouched_status_image_tag
image_tag("open", { :alt => "Offen", :title => "Offen", :size =>
"12x12", :class =>
2006 Jun 14
5
InstantRails Lost connection to MySQL server
Hiall,
I just tried out InstantRails version 1.3a. After a virgin install and
filling the fresh mysql db with my app schema, I tried runningthe app
with webrick, only to see the infamous "Lost connection to mysql
server" for every action. What is it that I''m doing wrong? I also have
mysql 5 installed on my machine, but the service is stopped while
experimenting with
2006 May 18
6
Form actions with additional parameters
Hiall,
I want to give the action of a form an additional parameters but can''t
figure out how to do it. My code looks like this
<%= start_form_tag :action => ''create'', next_step => true %>
<%= render :partial => ''user_form'' %>
<%= render :partial => ''community_form'' %>
<%= submit_tag
2006 May 01
7
ActiveRecord and Database Views
Hiall,
If I have say 10 tables that i would like to wrap up in 1 view to
manipulate data inside these tables, do I then need 10 model.rb files
for all 10 tables plus 1 for the view, or do I just need 1 model.rb
file for the view ?
cheers
Martin
2006 Jun 09
5
Using link_to with an image tag & link text
Hi ,
I was trying to use link_to along with image_tag
to setup a link that would open in an external window.
But I was unable to make a link using both text & an image
So my current workaround looks like this inside a partial
where link is http://foo.com & text would be descriptive
<img src="images/arrow.gif" border="0"/> <%= link_to(text, link,
:popup
2006 May 22
15
collection_select default selected value
Hiall,
Unfortunately I just can''t find out how to setup a default selected
value when using collection_select. My call is like so:
<%= collection_select(:consultant, :lastname, @consultants, :id,
:lastname, { :selected => @current_consultant.id } ) %>
which is not working, I debugged so far that I know that
@current_consultant.id contains the correct value.
Any tips?
cheers
2006 May 14
6
file and directory layout below app/models
Hiall,
Is it possible to organize my model files below app/models into
subfolders? E.g. I would like to put admin related models into their
own subfolder. This kind of structuring works for controllers and
views (scaffolding creates the right subfolder-model mappings), but
app/models always stays flat. I''d really like to be able to group my
code into logical, well packages :-) Yes, I
2006 Mar 27
2
svg image link
the link_to command is really nice, especially with confirm built in -
wondering if there is a way to use it with SVG images since SVG doesn''t
seem to work with image_tag
I can display svg images (in Firefox) with the following code:
<embed width=32 height=32 src="/images/quit.svg"
type="image/svg+xml"></embed>
"normal" link_to code:
2006 Jun 06
8
How do I wrap a <%= link to %> around an image?
I''ve got a bunch of dynamically generated link paths that I want to use
to link some dynamically-generated image paths. Specifically, I want to
link thumbnails in a gallery to the larger images.
But I''m stymied by Rails'' syntax. I can''t figure out how to do this.
I tried this:
<%= link_to(image_tag("../../images/photos/photo.photogroup/TN_
2006 May 14
4
script/console on windows
Hiall,
When I try to run script/console from a windows command line like
f:\rails_app\ruby script\console
I get the following error:
F:/Programme/Ruby-1.8.4/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require__'': no such file to load -- initializer (LoadError)
from F:/Programme/Ruby-1.8.4/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require''
2008 Oct 17
1
link_to + image_tag
i want to integrated link_to with image_tag
before i did link_to with image_tag like this
<%=link_to image_tag(image.filename
2006 Jun 12
6
Storing "money" in databases
Hiall,
I''m wondering what''s common practice when dealing with money values
stored in databases. I like the idea of storing all the values as
integers, i.e. all the values in eurocents not euros. Then I need to
multiply all values the users enter by 100 before storing them in the
database. Now the question is, what''s the most efficient and dryest
way to do this?
2006 Jan 13
1
file_column - how to test for empty column?
I am using the excellent file_column, but have run into an issue.
I am wanting the user to be able to *not* upload an image if they so
choose. Then I am trying to determine if that column is empty or not,
and display a generic image if that column is empty.
I have tried both of the following code blocks:
<% if @newsentry.image -%>
<%= link_to(image_tag((url_for_image_column
2006 Aug 04
5
image_tag + ActionMailer
Hi,
Any idea why image_tag doesn''t work within an email template? I''m trying to
generate the URL for an image and I''m getting the following error.
undefined method `request'' for #<Mailer:0x6a719e0>
I''ve been able to use link_to but no luck with image_tag.
I''ve seen a similar post to this in the list but no one has posted a
response.
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
2008 Feb 11
1
image_tag is it just plain Broken?
I''m trying
<%= link_to image_tag("#{gallery.link_to}"), gallery_path(gallery)
unless gallery.thumbnail_id == 0%>
and get the error:
ActionView::TemplateError (undefined method `image_tag'' for #<Gallery:
0xb7083be4>) on line #23 of app/views/users/index.rhtml
This is my definition of link_to
def link_to
unless self.thumbnail_id == 0
picture =
2007 Aug 13
1
link_to image_tag puts a box round my image
I''ve got a rather long conditional statement that either displays a
link_to(image_tag(blah)blah) or just an image_tag (i''ve edited it a bit
to show the structure):
<%= (article.score_from_user(:user_id => session[:user]) != -1)
?
(link_to image_tag("/images/down_arrow_grey.jpg", :alt => "down"),
:controller=>"article", :action =>
2006 Jan 23
4
an image that is a clickable link?
Hi,
How do I make an image that is a clickable link the rails way? Is
there a view helper for this?
Thanks,
Peter
2013 Jun 05
1
Link_to image_tag popup
Hello All,
How can I add a popup in link_to image_tag?
I am trying as :-
<%= link_to image_tag(@user.avatar.url(:small)), ''/users/edit'',
:popup=>[''original_image'', ''height=700,width=900''] %>
It goes to the edit page. But it doesn''t opens popup.
Is this the correct way to call a popup?
How can I achieve this?
Thanks,
2006 Mar 25
5
button_to with image?
I''m trying to use button_to and have it use an image in place of the
submit button. I had figured it would work the same as link_to like so:
button_to(image_tag("editicon", :size => "16x16", :border => 0), :action
=> ''edit'', :id => person.id)
but this instead displays the image code as the button name. Surely
there is a simple way to