Displaying 20 results from an estimated 10000 matches similar to: "Pass a variable via Link To"
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 15
8
Instant Rails on Win XP SP2
I am trying to run instant rails on windows xp SP2. I can get the
cookbook and typo sample sites to work with webrick but not with scgi.
When i click the start with scgi i get a blank dos window and typing
www.mycookbook.com returns
Firefox can''t establish a connection to the server at
www.mycookbook.com.
This suggests that apache is not even running even though the green
light is
2006 Apr 03
8
Layout problem
Hi,
I am creating a blog to learn ruby on rails. The blog.rhtml in the
layout folder has a the following code
<td width=150 valign="top">This is the left menu</td>
<td width=600 valign="top"><%= @content_for_layout %></td>
<td width=150 valign ="top"><%= render :partial => "categorylist",
:collection =>
2006 Aug 14
4
Controller method problem
Hi,
I have a def in my controller see below where i want to find the page
object based on a parameter value and then use the page_id to then find
all the contents that belong to that page in the same method.
Controller
def aboutus
@page = Page.find_by_name(params[''About Us''])
@contents = Content.find(:all,
:conditions => "page_id = #{@page.id}")
end
2006 Apr 12
4
Instant Rails SCGI Problem
I have installed instant rails and configured it
http://instantrails.rubyforge.org/wiki/wiki.pl?Getting_Started
I can get typo and webrick to work on webrick localhost:3000 but cant
get anything to work with scgi.
When i start the scgi server i get a blank dos window screen. When i
type www.mycookbook.com into the browser i get the following
Unable to connect
Firefox can''t
2006 Apr 07
3
Ajax render a template
In my blog a user can add comments. I want an Ajax call to add the
comment to the bottom of the comments list.
How to i return a comment thats is in the comment template and add it to
the bottom of the page. I have gotten as far as rendering some text
back to the form and the comment doesn''t display until i refresh.
This is my _newcomment.rhtml form to create a new comment
<div
2006 Apr 07
2
Paginate single items
Hi,
In my blog i display a post. I want to display a link tot he previous
post if there is 1 and a link tot he next post if there is one.
So i have in my controller
def post
@post = Post.find(params[:id])
@post_pages, @posts = paginate :posts, :per_page => 1
render(:layout => false)
end
And the following code in post.rhtml
<% if @post_pages.current.next %>
<%=
2006 Apr 05
7
Archive monthly count for blog
I am creating a blog to learn ruby on rails.
from the layout page i pass all the posts as a collection to
_archive.rhtml
<%= render :partial => "archive", :collection => @archive %>
On _archive.rhtml i have access to the collection. I am then gone to
render partial another page _archivecount.rhtml to display the number of
posts for each month.
Can anyone give a clue
2006 Oct 27
1
link_to
Hi there.
Is there a way i can have my link_to refer outsite the current controler
?
I have a path /refrences/ wich lists the refrences, and i want a link_to
in this template, to refer to the path /companies/show/company.id is
this possible ?
I have tried using: ink_to ''link'', :action => ''/companies/show'', :id =>
company.id
but with no luck, is
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 Apr 11
5
RJS adds comment but doesn''t update form
Hi,
When a user adds a comment i want to add the comment to the end of the
comments list using ajax so there is no full page refresh. The code i
have below adds the comment to the database but doesn''t update the
comments div with the new comment.
Can anyone help? This is my first use of rjs templates and i have read
http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates
2006 Aug 14
1
Overide the default find_all
Hi,
In my model i want to overide the default find all for sorting purposes.
Is this possible or can this only be done in the control or by adding a
custom method in the model.
def self.find_all()
@contents = Content.find(:all,
:order => ''pos, position_id'')
end
--
Posted via http://www.ruby-forum.com/.
2006 May 18
2
Lighttpd scgi error on windows
Hi,
I have followed the instructions below to get lighttpd and scgi working
on windows.
http://wiki.rubyonrails.org/rails/pages/HowToDeployWithLighttpdOnWindows
When i typ in the following address http://127.0.0.1:9999/ i get just a
blank white page.
In the scgi.log file i have the following error but dont know what the
problem is
[INF][3552] Running in production mode on 127.0.0.1:9999
2006 Apr 11
1
Apache configuration problem
Ive installed apache2triad on my windows xp machine. I have followed
the instructions on
http://wiki.rubyonrails.com/rails/pages/Fast+CGI+and+Apache2+for+Windows+XP
When i open a browser and type http://localhost/blog/ i get a file
listing directory with all my rails application folders inside the page.
If i click on the public folder i get the Welcome to rails web page.
Can anyone help?
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 Apr 05
8
Pass paramter via form
Hi,
I want to allow users ti search my blog. I have the following code
below to initiate the form.
<%= start_form_tag :action => ''search'', :search => search %>
<p align =center><%= text_field ''search'', ''search'',"size" =>"20" %>
<%= submit_tag ''Search'' %></p>
2006 Aug 03
1
RadRails install plugin problem
Hi,
I''m having a problem installing plugins in the latest version of
radrails running on windows XP.
I used the Plugin window in radrails to select file_column to install
file_column and everything worked ok.
Now i want to install remote_upload plugin which isnt in the plugins
list contained in radrails. So i select plugin from the generators tab
and type remote_upload and hit
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 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
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