similar to: Custom built link_to display text problem

Displaying 20 results from an estimated 10000 matches similar to: "Custom built link_to display text problem"

2006 Apr 01
10
You have a nil object when you didn''t expect it!
Hi, I am creating a blog to learn ruby on rails. I have 2 different views/models/controllers, 1 called post and 1 called comments. How do i link a post from the views/post directory to the comments that belong to the post in the views/comment directory. This is the code in the post/show.rhtml <%= render :partial => "post", :object => @post %> <%= link_to
2006 Apr 06
2
Quick Question: Using a CSS class statement in a link_to tag
Hi, I have a css file with lots of classes. I want different links on my page (which all use the ''link_to'' tag) to belong to different classes so that I can format their font, size, color, etc. Where or how do I use the css class name in the link_to tag? Thank you very much -- Posted via http://www.ruby-forum.com/.
2006 Jul 20
3
[OT Ruby] Displaying a binary ?
How to I display the binary equivalent of a number? I tried this: b = 0b1101 puts b # returns decimal value ( 13 ) b.to_bn # generates "unable to convert FIXNUM to STRING.." error. -- Best Regards, -Larry "Work, work, work...there is no satisfactory alternative." --- E.Taft Benson -------------- next part -------------- An HTML attachment was scrubbed...
2006 May 30
3
expected, got Fixnum problem.
Hi, I was wondering if anybody knew what ''<some type> expected, got Fixnum'' means? My code looks like the following: begin anevent = Event.new anevent.title = params["event"]["title"] anevent = session[:user_id] com = Community.find(params[:id]) com.events << anevent rescue Exception => exc ... end But I get an
2006 Jun 14
13
Undefined method
I really hope this is not a bad question (as in he''s abusing the list). However I could use a little direction (even though I''m reading books, tutorials) Right now I''m getting a undefined method `category'' for 4:Fixnum The specific lines from the rhtml file are: <td><%= link_to position.category_id.category, :action => "show", :id =>
2006 Aug 04
3
Pass a variable via Link To
Can anyone tell me how to pass a value from a link_to in a view to a controler? The value is just a piece of text for the time being. <%= link_to ''About Us'', :action => ''about'', :params => ''string'' %> ??? -- Posted via http://www.ruby-forum.com/.
2006 May 28
2
"if" clause in the view - - - (for two objects)
Hi, sorry to bother you guys with a simple sytnax question; i have a loop of objects taking place (ie, for page in @pages....xxxxxxx....end) and a link associated to each pages so that in the end it looks like this: page1 (link) page2 (link) page3 (link) . . . page n (link) (all of this done by putting a simple ''link to'' in the for loop.) now i need to seperate two pages
2009 Feb 24
7
Add .html extension by default
Hi all, i would like to add the .html extension by default to all my resources. What is the best way to do that? The reason for this is that i need to download the generated sites via wget and i need the .html extension for the downloaded files. Also it would be nice if the link_to would automatically generate the links with .html... Thanks, Gerold
2006 May 23
2
Ordinalizing a date
I''m trying to use the ordinalize() method to ordinalize a day. Here''s how far I''ve gotten: @reportday = Time.now.at_beginning_of_week.strftime("%d").to_i @ordinalized_reportday = "#{@reportday}".ordinalize I was thinking it wasn''t working because the date is being returned as a string, however I added the .to_i and still it returns an
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 31
1
embedding link_to''s as part of rendered text.
Hi, I''d like to be able to do a database query, fetch some text, and add an ''Accept Request'' and ''Deny Request'' within the text. Both of these would be links so if the user were to click on them, they would essentially send POST requests back to the server. Since this is dynamic, I wanted to know the safest/best approach in embedding these links
2006 Jan 30
3
general questions
Agile book lacks some basic information, perhaps I need to learn ruby as I am lacking information - some basic things - especially debugging. The following are stupid newbie questions and any portion of them answered would be great. 1. If I am viewing a page from app/views/clients/ and on this page, I want to put a ''link_to'' directive to say app/views/case_managers... how do I
2006 Jun 07
2
Hash flattening on paginator link_to
Hey I need some help with pagination and the link_to in the view. I''m trying to include a hash in the pagination link_to params and it keeps flattening out my hash. Example: Here''s my hash called @answer: "answer"=>{"6"=>"9bf31c7ff062936a96d3c8bd1f8f2ff3", "7"=>"6f4922f45568161a8cdf4ad2299f6d23"}
2008 Jan 03
3
how to use "link_to" to deliver a parameter?
Hello, there: I wish A link to invoke such a action together with the parameter "zh_CN" "cookies/switch_language/zh_CH" to switch language sellection, and I use the following code: <%= link_to ''Chinese'', :controller => ''cookies'', :action => ''switch_lang'' %> But, how is "link_to" able to convey
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 May 24
1
link_to CSS problem
Hi all, I''m a Ruby/Rails/web development newbie, so this may be a stupid question. I''m putting some links using link_to into my rhtml page, creating the layout using the DIV tag: <div id="description"> <%= link_to h (item.description), :action => ''show'', :id => item.id %> </div> ... div#description { float: left;
2007 Dec 06
2
passing parameters through link_to
Is it possible to pass parameters through link_to that will be used by the controller that link_to directs to? Specifically I have this code: <% for user in @users -%> <%= link_to user.screen_name, {:action => "index", :controller => "users", :user_id => user.id } %> <% end %> Is it possible to use the parameter at the end of link_to(:user_id
2007 Nov 14
3
absolute urls in url_for vs. link_to
In both url_for and link_to, the :only_path param can be used to determine whether the link url used is complete with hostname and path, or just has the path (a kind of relative url). However, in url_for it defaults to false (urls with hostnames), and in link_to it defaults to true ( urls without hostnames, just paths). Is there any reason for this discrepency? To me, it violates the principle
2006 May 11
3
can''t call link_to from within a model class
can anyone tell me how to call link_to from within a model class? I''m trying to do something like the following: validates_uniqueness_of :email, :message => "address has already been taken. If you''ve forgotten your password, please click " + link_to(''here'', :action => ''forgot_password'', :controller =>
2013 Mar 15
5
link_to should have its body and url arguments reversed
I think the link_to helper method is quite confusing with its arguments order: link_to body, url link_to "Click me", @person Why is it thay way round? I want to make a "link to [the] person", so I would expect the order to be: link_to @person, "Click me" It reads much more natural. You don''t "link to [the] body", you "link to