Displaying 20 results from an estimated 20000 matches similar to: "Newbie Question on Link_to Method"
2006 Jul 22
3
Newbie: Replacing index.html in public folder
Hi,
Can anyone tell me how can I achieve this:
Say if I have a e-commerce site, I want to list all the products when
user type in www.mysite.com Not www.mysite.com/products
Please note there is no controller in the URL, how do I replace the
default Rails index.html and display my products page.
Hope my question makes sense.
-- 
Best regards,
Ming Ma
2006 Aug 06
1
Newbie: populate 2nd dropdown list based on user''s selection in 1st dropdown list
Hi,
I am creating a form that a user can post a message based on his
selection on category and   subcategory. (A category has many
subcategories.)
How do I dynamically populate subcategory dropdown list when user
chooses a category from category dropdown list?
Thanks in advance.
-- 
Best regards,
Ming Ma
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 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 Mar 28
3
Brand newbie question relating to link_to
I recently dived into Rails and am having trouble with the link_to method.
I''d like to pass some parameters to the action being called and am not sure
how to do it.   Essentially, I want to hyperlink a total count of bugs
queried from the database to a method that will return the bug numbers when
clicked on.  I have a method, bug_total, that returns the total number to
display in the
2006 Jan 20
4
[newbie]how to use link_to to link to another controller?
I am just diving into Rails and I am a bit puzzled by the link_to function.
am writing an app to display my photographs in categories. My application layout
has a sidebar to show a menu with categories from the categories table in the
database (like in taken from the tutorials), to be shown on every page.
I managed to get a global @menu_categories object that keeps track of all the
categories
2005 Dec 15
6
passing parameters to link_to OR better way to do this?
Hi All:
I''m writing my 1st Rails app and I can''t seem to find the answer on
the web or in the book.
I''m making a table, and I want to be able to expand a filename.  The
code is basically as as follows below.  In the last <td> entry, I want
to call an action and pass in the test_results_path, which I will go
and read a file and munge the data for a separate
2007 Jul 31
2
link_to
Im trying to use the link_to helper to open a blank window which is
basically just a framed window to display user info without all the
extra distractions that come along with opening this window. Here is
what I got:
<%= link_to ''Airline Preferences'', {:action => ''airline_preferences'',
:id => @user.id, :method => ''post'' }, :target
2007 Jan 02
2
link_to method throws a url_for error
This error seems pretty bizarre. I''m using ActionMailer and am using  
a template in app/views/welcome_mailer/join.rhtml which has this line:
<%= link_to :controller => ''group'', :action => ''join'', :group =>  
@group.id, :ic => @code.code %>
The error is: undefined method `url_for'' for #<WelcomeMailer: 
0x2aaaad4fb470>
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 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
2006 Jul 03
2
1.1.4: link_to with mixed case controller names "broken"?
I have a side navigation bar with links embedded in it like the 
following:
<%= link_to( ''Create Job'',
                  { :controller => ''eSimply'',
                    :action => ''upload'' }) %>
This link now shows a routing exception
Recognition failed for "/eSimply/upload"
This link has worked for over through Rails
2006 Aug 03
3
helpers: newbie problem
please help me with my code:
im calling a helper, which has to return different links.
--list.rhtml
...
<% for message in @messages %>
<tr>
 <td><%= message.author.send(''name'') %></td>
 <td><%= message.send(''date'').strftime("%d.%m.%y/%H.%M.%S") %></td>
 <td><%=
2006 Apr 04
2
How to apply class from Stylesheet to "link_to" element???
Hi,
This is the "img" class for anchor element inside my stylesheet.
=====================
A.img:link {
	color: #ffffff;
	text-decoration: none;
}
A.img:visited {
	color: #ffffff;
	text-decoration: none;
}
======================
I can easily apply this tag inside my html document as follows:-
=======
< a href="goodbye.html" class="img">
=======
Now I want to
2008 Feb 20
1
link_to weirdness, related to namespace?
Hi,
In my app/views/admin/clieint/_searchresults.rhtml partial, I have ...
<% for user in @users %>
  <tr>
    <td><%=h user.ship_to_first_name %></td>
    <td><%=h user.ship_to_last_name %></td>
    <td><%=h user.email %></td>
    <td align="center"><%= link_to ''Show'', {:action =>
2006 May 13
1
need help for my link_to
I have a model Document that shares the same primary id with another
model Upload, I would like to put a  link on _list.rhtml of my
document to edit the upload of the same id.
I tried something like <%= link_to ''Edit'', {:controller => upload,
:action => ''edit'', :id => document} %> but obviously that''s wrong. Any
idea how to make it right?
2006 Jan 03
1
Passing parameters with link_to
I have following code in my controller:
class AlbumsController < ApplicationController
  def list_by_year(year)
    @album_pages
    @albums = paginate :albums,
                       { :per_page => 10,
                         :conditions => ["year = ?", year] }
    render :action => ''list''
  end
end
Now I want to make a link to the list_by_year action in
2006 Jan 16
5
A function that return a link_to, Possible ?
Hello, I try this :
in application_helper.rb
-----------------------
def lnk bla
    return link_to bla,  { :controller => bli , :action => "blo" , :id 
=> "blu" }
end
in file.rhtml
-----------
<%= lnk "yo!" %>
This return an error. There is a way to do this or something similar, or 
this is completly impossible ?
Thanks
2008 Feb 19
1
adding an onclick option to link_to method
Hello,
I''m trying to use the rail link_to to open a popup window and then
print the popup window at the same time.  Is there a way to add
another "onclick" option to tell the popup to print?  I know how to do
this in javascript but not sure how to use the rails help to do it.  I
also am aware that the link_to_function method is used to call a
javascript function. 
2006 Apr 01
3
Quick question about <% link_to something, :action => ...
Hi,
I have a basic question. when i use
<% link_to show_city,
:action => ''my defined action''
:id     => ''something'' %>
//what is ID here? is this the parameter in my mysql db?
basically
how can i put a parameter into the link that when it hits my function,
it can tell my function what to use as a condition to search. for
example i have a table of