Displaying 20 results from an estimated 9000 matches similar to: "Newbie question on has_may : through and link_to"
2006 Aug 01
2
restful controllers - howto nest with link_to?
Hi List,
I''m trying to get my grip on the restful methods that are now part of edge
rails.
Making the first steps was impressive as well as easy because there are
already great resources on the blogs of early adopters:
http://www.ryandaigle.com/articles/2006/08/01/whats-new-in-edge-rails-simply-restful-support-and-how-to-use-itand
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 =>
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;
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
2011 Jan 06
2
Link_to parameters
Hello,
I would like to have a link_to automatically populate a field in the
form that it is linking to.
For example (excuse my silly words, im trying to make a point)
<%= link_to "Add a COOL Post", new_post_path, :howcoolisit => ''COOL''
%>
<%= link_to "Add a NOTCOOL Post", new_post_path, :howcoolisit =>
''NOTCOOL'' %>
Then,
2006 Jul 13
3
strange behavior with link_to for "blog" and "gallery"
Okay, what''s so different about the bellow code? When I use the link_to
function in a partial (three times passing "Stats", "Blog", and
"Gallery")...
<%= link_to(menuItem.to_s, :controller=>menuItem.to_s.downcase)%>
I get...
<a href="/stats">Stats</a>
<a href="/blog">Blog</a>
<a
2006 Apr 20
0
link_to mapped urls
Hi all,
I want my link_to links direct to my mapped urls, not the long ones with
controllers and actions in them.
What I have:
in view:
<%= link_to "random url", random_url %>
routes.rb:
map.random ''random'', :controller => ''start'', :action => ''random''
link_to results in "http://localhost:3001/start/random"
2006 Jan 22
0
link_to query string
Here''s a simple one I think.
Using link_to, how do you get multiple fields in the query string?
link_to("anchor text", {:action=>"neat_page", :field_1=>"value 1",
:field_2=>"value 2"})
-this only gets you field_1 in the query string
as does this -
link_to("anchor text", :action=>"neat_page",
2005 Oct 15
0
Making link_to use the routes I define
Hi,
In my rails application I have a controller (message) that handles all
top-level directory requests, and maps it to a list view.
How can I use link_to to link to the URLs generated by this route?
map.connect '':forum_url_name/'', :controller => ''messages'', :action => ''list''
Then I have a (forum) controller that lists all its
2005 Nov 29
0
undefined method `link_to'
Hi, all I''m trying call link_to from another helper
but got this error:
undefined method `link_to'' for module `UserHelper''
how can I get access to helper from another helper? this is my
users_helper.rb:
module UsersHelper
alias ink_to_original link_to
alias link_to link_to_permission
def link_to_permission(name, options = {}, html_options = nil,
2005 Jul 17
0
RE: link_to and CSS
What you want is a.linkCommand:hover, etc
-----Original Message-----
From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
[mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Shelby Westman
Sent: Monday, 18 July 2005 2:20 AM
To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
Subject: [Rails] link_to and CSS
I am a bit confused about how
2006 Feb 07
0
scope problems testing a helper method that calls link_to()
We''ve been having problems writing functional tests for helper methods
that rely on ActionView methods. Here''s a specific example.
In application_helper.rb I''ve got a method called ''party_link()ยจ:
def party_link(party)
link_to party.full_name, { :controller => ''contacts'',
:action =>
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
2006 Apr 02
2
Custom built link_to display text problem
Hi,
I want to display the number of comments for a post in a link_to. So
the link will look like below.
Comments(3)
How do i build this string in the link_to. I get an error about trying
to convert a fixnum to a string see code below.
<% case post.comments.size
when 0 %>
<p>No Comments</p>
<% else %>
<P><%= link_to
2007 Jul 06
1
Edge, link_to and mocks
Hi All,
Anyone noticed that using the newer link_to syntax in edge currently
fails with mocked objects in view specs or helpers.
eg. if you have something like the following in your view (or
equivalent in a helper):
<%= link_to @dog.name, @dog %>
as opposed to the current 1.2 syntax:
<%= link_to @dog.name, dog_path(@dog) %>
Using a mock_model as the ''dog''
2007 Feb 27
1
link_to :post true Newbie question
Hi All,
I am attempting to use a link_to helper to perform a form post using the
following construct:
<%= link_to ''Save'', {:action =>''create''}, :post => true %>
What I find is the parameters passed to the webserver are empty. My
model validation stuff triggers indicating the fields in question are
empty too. This is to create a new DB entry so no
2006 May 11
1
Including dynamic list of params in link_to
How do I include all incoming URL parameters (i.e.
list_content.rhtml?content_id=23) in my link_to statements?
I know I can include specific parameters in the link_to, by using
":variable_name => 123" in the link_to statement... But what If I
dont'' know what the incoming parameters will be... and I simply want to
include them along with any other specific variables I
2008 Jun 13
1
link_to problem with '.' in :id parameter (must be escaped!)
Hi,
I have this very normal link_to call:
<%= link_to name, tag_path(name) %>
The ''name'' can be something like "ASP.NET". That results in a URL like
http://localhost:3000/tag/ASP.NET
The Problem: I get a "no route" for this URL. I have a route
map.tag ''/tag/:id'', :controller => ''items'', :action =>