similar to: How do I wrap a <%= link to %> around an image?

Displaying 20 results from an estimated 1200 matches similar to: "How do I wrap a <%= link to %> around an image?"

2006 Jul 17
6
3 newbie questions
hey all, I have 3 tables like this: Images (id,name) Tags (id,name) ImagesTags(imageid,tagid) in my image model I do a "has_and_belongs_to_many :tags" but to make it work I need to rename ImagesTags(imageid,tagid) to Images_Tags(image_id,tag_id). My question is that given that I can''t rename the table, is there any way to make it work with the original names? Second question:
2010 Sep 15
2
Get File Names in Folder, Read Files, Update, and Write
Dear All, Could you please recommend how I can do this? I have several text files in one folder. Let's name them A0801.RSK, A0802.RSK, .... I would like R to 1) Know all file names in this folder 2) Update value in one column of these files 3) Write results in another text file with _xval in the file names Below is R code for read, update, and write one file
2006 May 12
8
switching from development to production?
I think I''m missing a step here, but they don''t seem to cover this in the AWDWR book... does anybody know the various steps required to switch from development to production mode in Rails? I''ve scoured the application and changed everything that stands out, but the damn thing is still running off the development database and won''t connect to the production
2006 Apr 07
22
Find WHERE in Rails
I''d like to find all records that have a certain integer as their "level" field in the database. I know how to find all the records: allquestions = Question.find(:all) ...and I know how to find the one record that has a certain id: allquestions = Question.find(params[:id]) ...but how do you find all the records that share a certain value in one of their fields? I tried
2012 Oct 09
2
Text file: multiple matrix
Hi there! I'm a newbie in R This is my problem: I have a txt file composed by 100 matrix (256x256) separated by a blank line! How can I save automatically the matrix in separated txt file (100)? e.g. 1? matrix from line 1 to line 256 257 blank line 2?matrix from line 258 to line 513 514 blank line 3? matrix from line 515 to line 770 771 blank line 4? matrix from line 772 to line 1027......
2006 Jun 01
4
How do I get today''s date?
I know this is a simple question, but i just want to put the current day, month, date and year on my website. I still can''t figure out how to read the Rails API. Can anybody help me out? TIA -- Posted via http://www.ruby-forum.com/.
2006 Apr 03
15
How should I pick a random entry from the database?
Hi guys. Total newbie here. I''ve been doing web stuff since 1996 but only began the foray into scripting last year. I haven''t got my skull completely 360 degrees around OOP yet. It''s just me here (in Japan) and there are no Ruby groups in my area (never mind any in English). I''ve got a database table - real simple: question, answer, and id fields - and I
2006 May 17
5
Today is "Rails Hates Me Day"
Has anybody had Rails just refuse to cooperate with anything? I had an application working great in development mode, then switched it over to production, tried to host it, but couldn''t. Some error that I can''t figure out. So I decided to create a simpler application, host THAT in little baby steps until something went wrong so I could tell maybe where I was losing it.
2006 Apr 06
2
making an integer from a float
Does anybody know how to turn a floating-point number (i.e. 60.345) into an integer by cutting off or rounding the decimal portion? Either method, or both, would be quite welcome. Thanks! This forum rocks! -- Posted via http://www.ruby-forum.com/.
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
2009 Oct 25
3
Image_tag Positioning/Alignment
Hi: I searched the forum before posting and could not find any help on how to position an image using image_tag (''image_name''). I have an image in a div, and I need to move it to the right. How do I this? I have this code: <div id="mainDivright"><%= image_tag (''name.gif''), :options => {:align=>"right" } %></div> I
2007 Mar 24
4
image file URL generated by image_tag include some parameter
I''m using image_tag to generate img tag. URL of image file generated by image_tag include a parameter like following. "http:// ..... /images/filename.gif?123123123" What''s this number parameter for? How can I remove it? I''m using rails with built-in WEBrick server in test mode. --~--~---------~--~----~------------~-------~--~----~ You received this message
2005 Aug 31
5
image_tag :align => 'absmiddle' ?
hi, i''ve been through the rails apis and searched through past rails discussion, but i haven''t managed to find a way of aligning images with the image_tag() method. ideally i''d like to write something like image_tag("image.gif", :align => ''absmiddle'') to position the image vertically in the middle of some text. thanks luke
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
2005 Dec 16
5
Question: image_tag(source, options = {})
image_tag(source, options = {}) Ok, when I want to use an image I added the following code: <%= image_tag "dsf.jpg" options = {[align="right", style="padding-right: 10px; padding-top: 5px;"]} %> However, this doesn''t seem to work, it doesn''t like how I have the "options" part setup. I''m sure there is something very easy
2006 May 31
3
Database can''t connect -
I''m sorry guys. I''m really still such a newbie at this. i''ve been having trouble getting my Rails apps to run on Dreamhost, and I think it might be a problem with the database connection. Anyway, I read on Code Snippets that I should do this: [rhod]$ ruby -Iconfig -renvironment -e "p ActiveRecord::Base.connection" to find out if my database.yml file is
2006 May 09
3
Named link to image
Hiall, Call me stupid if you like .,) but it seems i can''t figure out how to get a named link using a combination of link_to and image_tag. What I need is basically a link displaying a name along with some image to indicate status (open,working,finished). I found no combination of link_to and image_tag that accepts a name, this seems to be solely used for making whole images into links
2007 May 19
4
button_to_function with image?
Hi: does button_to_function allow the use of an image? I tried it in place of the text with "image_tag" and it doesn''t work. Maybe some form of button_to? Any direction you can give would be great! Mike -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups
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 Jul 05
3
splitting a story with double-spaced para''s
Quick question - if i want to separate a long string of text, separated by single carriage returns, into an array of paragraphs, I can use the following code: paragraphs = article.content.split("\n") The "\n" means a carriage return, as far as I can tell. If I wanted to take text, that had been written using the more common double carriage returns, into an array of