(no subject)

HELP

Hi,

I’m a Ruby on Rails newbie. I’ve been tasked with building our office’s
first ROR application, and I am the only one working on it, so I am
muddling through with a couple of books… Moving along slowly but need
some discussion time with some people who KNOW it and can maybe offer
some answers to questions I haven’t found in my books.

First - what is the fundamental difference between “render” and
“redirect_to” when working with .rhtml forms in the Controller? When is
it appropriate to use these?

Second - Why do I sometimes have to use a while loop to access my
queried data in the .rhtml form? Example:

Controller-Edit Method

@edit = Cause.find(:all, :conditions => “case_id = ‘#{@caseid}’”)

View-Edit.rhtml

Editing Case <%= @edit.case_id %>

This method of data retrieval has worked for me in other similar forms,
and I can’t figure out why it won’t work here. The error it gives is
that case_id is not a valid method, but it is a valid field in the
table, so should work. (case_id is the foreign key for the table)

However, if I put the data retrieval inside a while loop, it displays
the data, but gives me a routing error when I try to update.

I have other questions as well, but I guess I’ll start here. ANY AND
ALL tips, advice, etc. would be greatly appreciated!!

Thank you,

Ali Williams

Systems Developer II

Washoe County IT

775 328-3720

Firstly, you want the Rails list at
http://lists.rubyonrails.org/mailman/listinfo/rails, and secondly you
want to stop using Comic Sans MS for emails. Send plain text, it gets
though lists better.

“Phillip H.” [email protected] writes:

Firstly, you want the Rails list at
http://lists.rubyonrails.org/mailman/listinfo/rails, and secondly you
want to stop using Comic Sans MS for emails. Send plain text, it gets
though lists better.

And specify a subject.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs