Displaying 20 results from an estimated 21 matches for "rails001".
2010 Apr 13
5
How to check if a parent has children?
What is the new way to check if a parent has child items? In rails
1.2.6 I did this:
if @client.has_line_items?
Client being the parent and line_items the children.
Now that I have upgraded to rails 2.0.1 (on my way to current :-) ) I
am getting this message:
undefined method `has_line_items?'' for #<Client:0x7f3b093b01a0>
How should I format the query now?
Regards,
Paul
2006 Jul 04
2
links to images keep breaking
Hi,
I have a catalog that has images in it. The images are stored in
public/images/....
When I open the catalog via the catalog controller I get this url:
http://127.0.0.1:3000/images/sow/sow.jpg
for the images and they display correctly.
When I link to the catalog from another controller and view I get this:
http://127.0.0.1:3000/catalog/images/sow/sow.jpg
If I attempt to put and image
2006 Jul 03
5
How do I code this conditional statement in Ruby
Hi, I am a COBOL programmer and I am busy teaching myself Rails and Ruby.
In COBOL I can code this conditional
If x = 1
next sentence
else
..........................
The "next sentence" statement enables me to get out of the
conditional. How would I code the same thing in Ruby? In C you could
use break but I understand that Ruby has no break statement.
Regards,
Paul
2010 Apr 13
2
Advise sought: Upgrade from Rails 2.0.1 to current
I have upgraded from 1.2.6 to 2.0.1 and successfully passed all my
test and manual testing. Everything seems to be working correctly. My
application is pretty vanilla and so there where few complications.
Question is, should I do another point upgrade (and if so, which
point to upgrade to next) or is it safe (and prudent) to just go
straight on to the current version (2.3.x).
Advise would be
2006 Jul 03
1
Print link or button?
Is it possible to create an action that would sent a view straight to
a printer or a button of some sort that would enable the view to be
printed. Currently the user has to click on file and then on print in
the browser to print. My users would like to be able to click on a
link or button and have the view printed. Is such a thing possible?
And how would one do it?
Thanks,
Paul
2006 Jul 19
3
How do I check the retuned value from check_box_tag?
Hi,
I have this in my form
<%= check_box_tag(@accept, value = "1", checked = false) %>
Which puts a nice checkbox on my form but when I try to retrieve the
value that is returned, which I expect to find in @accept, there is
nothing. How do I check the returned value?
Thanks,
Paul Thompson
2006 Jul 19
6
Howto: Check_box with a variable (no model)
Hi,
I would like to put a checkbox on a form where the input field is a
variable rather than a field in a model.
The normal way (with a model) would be:
<%= check_box(''client'', ''accept'', {}, "1", "0") %>
But since accept is a variable @accept and model client will not be
there, how do I make a check box work?
Regards,
Paul
2006 Nov 23
2
Returning to the same position on a page
Hi,
I am not sure if this is a general web question or a Rails specific
one but either way, I would really appreciate help and guidance.
My application generates quotes. To do so, you start at a page that
has the client details. From there you go to a catalog (a link on the
quote page) and select the items that are to be in the quote. All the
above is working just fine.
My problem is that when
2010 Mar 07
1
Upgrading rails project - version 1.2.6 to current (2.3.5)
Can anyone please advise me what is involved in up grading a project
from version 1.2.6 to current (2.3.5). The project is pretty much
vanilla code and does not use plugins. Are there scripts that can do
the job (or pull out incompatibilities). Any websites or blogs that
point the way or should I just bite the bullet and rewrite? Reason for
wanting to upgrade is that I now do want to add features
2006 Jun 15
2
How to pass a varible from controller A to controller B
Please, can somebody tell me how to pass a variable from controller A
to controller B. I am going crazy trying to work it out but I am not
getting anywhere. This has got to be a simple thing, only my ignorance
is holding me back!
Thanks,
Paul
2006 Jun 16
1
Nuby Question: How best to read a child record?
I want to read through all the child records for a given parent. What
would be the correct way to do this? Advise would be most welcome.
Regards,
Paul
2006 Jun 27
2
Using a different layout/styleshheet
Hi,
I have a view that I use to display and capture data. Once the user
has input the required data, I then need to be able to print the view.
I know that I can setup a stylesheet to take care of the page layout
but it is not clear to me how I will make the print view call the new
layout.
If anyone could clarify this or point met in the right direction, I
would be most grateful.
Regards,
Paul
2006 Jun 27
2
mail_to link where the recipient is a variable
Hi,
I want to put a mail_to link in my views, where the recipient is a
variable stored in the database. It is not clear to me how I would do
this from reading the docs. Could someone please explain or point me
in the right direction.
Thanks,
Paul
2006 Apr 30
0
Howto: show to tables on one page?
Hi,
I have two tables and they have a one to many relationship I want to
display the contents is a browser. Parent with its children beneath
it. How do I do this. I am a rails (and Ruby nuby) so am pretty
ignorant.
Regards,
Paul
2006 Mar 30
1
Howto configure Lighttpd with fastcgi on Ubuntu?
Hi it''s Noobie Thompson, new to linux and to rails.
Has anyone configured Lighttpd with fastcgi to run rails on Ubuntu? I
am useing Dapper
(flight 5). I have php5 with php5-cgi (downloaded via Synaptic). I
have got lighttpd installed and running but I am unable to get the
fastcgi/rails side going. I get message to the effect that I must
recompile php with Fastcgi enabled. Can anyone help
2006 Nov 04
0
Page Navigation
Hi, this is probably not strictly a Rails or Ruby question but I hope
that someone here can answer it or at least point me in the right
direction.
1. When you click on a link to ''B'', within a long page ''A'' (IE. one
that is bigger than the browser window so you need to scroll to
navigate it) When you return from ''B'' via a link (to
2010 Apr 25
1
Has anybody succeed in getting Rails 3 to work in production?
Has anybody succeed in getting Rails 3 to work in production? I am
trying with Apache 2.2 and Passenger 2.2.12 but no luck. If you have
got Rails three to work in production on any server with any set up
could you please post the details (howto?) or a link to where such
information can be found.
All input gratefully received.
Paul Thompson
--
You received this message because you are
2006 Jul 08
4
Hidden fields in forms
Please can someone show me the correct syntax for a hidden field in
forms, this is my code
<%= start_form_tag :action => ''create'' %>
<div class="form1">
<table width="auto" boader="8" cellspacing="5" cellpadding="5">
<% hidden_field ''line_item'', ''client_id'', :value
2005 Dec 29
4
Images in Agile Web Development with Rails
Hi,
I am working through Agile Web Development with Rails and I am at pg 69
second last paragraph says "put some images in the public/images
directory......" how do you code the link that is stored in the data base I
have tried http:public/images/name .jpg with no avail I have tried the fully
qualified address http://home/../../../../name.jpg also with no luck. How
should I code this?
2006 Apr 27
5
ERb on he command line re: Ruby For Rails book
Hi,
I am working thru the Ruby for rails book. On page 30 David Black
talks about running erb from the command line i.e. $ erb erbdemo.rb
just as you would a normal ruby prog ($ ruby erbdemo.rb) but when I
try to do this I get command not found. How do I make this work? I am
running Linux (Ubuntu Breezy)
Regards,
Paul