Displaying 20 results from an estimated 3000 matches similar to: "myObject.send(column.name) from Agile Development book"
2005 Dec 30
9
SELECT MAX
How does one do a SELECT MAX query in rails? I''ve searched and searched and
tried lots of things with no luck.
I want to implement "SELECT MAX(column_name) from table_name
and have it return the maximum value from column_name. I just need to get
that one value, not the whole object...
Thanks for any ideas...
Shelby
_______________________________________________
Rails mailing
2006 Jun 15
3
how to give a form a name
Using a <%= form_tag ... %>, how do I give a form a name, so that I can
reference it with javascript? I sure can''t figure this out from the docs...
Thanks,
Shelby
PS - what I am trying to do is just have the focus in the first form field
when the form is loaded. There has to be an easy way to do this, but I
can''t figure it out...
-------------- next part --------------
2006 Jun 13
7
model validation across multiple views
I have a rather complex object with a number of attributes. For a variety
of reasons, I would like one view to create the object with only a couple of
fields completed, then a second and third view to finish all the fields. I
would like the model to validate_presence_of all these fields, since
eventually I need them all there, and I would like each page to validate its
portion of the fields that
2006 Aug 02
3
faster? database search or rewriting objects
I''m having an argument with my son :) I have a table with about 1500
objects called entries. I need to do something with about 100 of them
(schedule manually) I say I should just mark them with a boolean when I
have scheduled them. (manual == true) My son says I should pull them out of
the entries table and copy them to new objects (lets call them "manual"
objects, and store
2006 Jul 09
2
serialized DateTime objects returning as Time objects
I have a database field called dates in which I am trying to serialize an
array of DateTime objects. When I unserialize them, they are coming back
in as Time objects. I know this, because I am getting errors that say
"comparison between Time and DateTime failed.
Why is this happening? Is there a way to prevent it??
Thanks Shelby
-------------- next part --------------
An HTML attachment
2005 Dec 30
3
Too many columns for list.rhtml to display on one page
I''ve gone once through the Agile book and am now attempting my own rails
app. I''ve created a table named ''volunteers'' with over 15 columns. The
problem is the default list.rhtml that is created with the scaffold,
shows all the columns. I only want to show 4 of them with the list
view.
Where would I start to only return a handfull of columns to the
2006 Apr 27
2
"for column in..." not picking up _id columns
My code executes fully:
<% for column in ModelName.content_columns %>
<th><%= column.human_name %></th>
<% end %>
but it does not pick up any columns in my model''s table that end in
"_id".
Is this by design?
Is there a helper method that will reference the related tables? Or
will I need to code the column titles and detail records by
2005 Aug 07
3
tracking online users
Let''s say I have an application and I want to create an admin program
that will show me who is currently online using the application. I
don''t know the best way to do this. Assuming I am storing my sessions
in the default PStore, I don''t suppose there is any method that lists
all the active sessions, is there?
The only way I can think of to do this is to setup a
2005 Dec 31
4
saving a collection
Reading the Agile book, I can''t find a single command to save a collection.
The save command seems to operate on only individual objects.
Lets say I have a collection that I have received from a find_all command.
I want to go through and change some attributes in various objects in the
collection. Then I want to resave the whole collection back to the
database. I don''t think
2005 Dec 31
7
Dynamic form? Not really!
Hi guru''s out there,
Im happilly coding my first rails app, and all goes well. I find myself
manually coding in a particular field all the time (company_id), that relates
the contact to a company. The total coding of this form seems somewhat much.
Could somebody tell me what Rails power I''m possibly missing and stuborn as I
am trying to do myself?
I was wondering if the
2006 Aug 07
3
character encoding in RoR
Hi, I''m a newcomer to Ruby and to Rails, and am having a problem with
character encoding.
Now, I know ruby doesn''t handle unicode...but, characters like ? (eacute)
and ? (ccedil) are part of the iso-8859-1 charset, so it shouldn''t be a
problem, right?
But, for some reason, the string functions still seem to hang on those
characters.
As an example, in a brand new rails
2005 Dec 26
2
confused about ruby fast C bindings
I am confused about ruby fast C bindings. Does the command:
gem install mysql
install these?
Is this page:
http://www.tmtm.org/en/mysql/ruby/
the home page for these bindings? If so, it gives no instructions about
installing them with using gem.
Wondering if this is all the same???
Thanks for any help...
Shelby
_______________________________________________
Rails mailing list
2011 Oct 20
2
Agile book apache2.conf: Forbidden You don't have permission to access / on this server.
Appreciate any help -
I am working through Agile web development (4.0) and am stuck on the
deployment using phusion passenger. I get this:
"Forbidden
You don''t have permission to access / on this server."
when I put depot.yourhost.com in the browser.
I have been through various web searches and for file permissions and
suggestions to change the <Files> container.
2006 Aug 05
1
Viewer Problem
In a standard scaffold generator, the list.rhtml looks something like
this ...
<% for column in Book.content_columns %>
<th><%= column.human_name %></th>
<% end %>
How can I modify this code so for each table column add my own name not
the "human_name" generated code?
--
Posted via http://www.ruby-forum.com/.
2006 Mar 17
4
Noob question about the "show" function
i''ve got a cool app going and it''s getting bigger and bigger, but now
i''m trying to customize the show function. i''m using the scaffold code
as a base but can''t seem to get anything to look right. i guess i''m
confused about how exactly the scaffold code works for the "show"
function. any help would be awesome! thanks.
jon
--
2006 Jul 03
2
moving data from legacy database
I have rewritten a java webapp into rails. The database structure is
basically the same except that:
1) in the legacy app, several of the tables did not use ID numbers,
but relied on other fields as the primary key
2) in the legacy app, there is a join table that uses email address
and category names to do the join, not ID numbers
I would like to move or change this database to match my new
2006 Jan 08
0
Agile book depot question
I have been working on implementing a variant of the depot example as a
method of learning rails. I have come up against a css question that is
driving me nuts. This may not be the right forum to ask this question. If
anyone would like to refer me to another place to ask, I would be grateful.
Most of the code that I am working on is straight from the examples, with
minor alterations. What is
2005 Jul 16
2
Applying css style to a link_to
What is the proper syntax to apply a css class to a link created using
link_to?
I''ve tried
<%= link_to("details", :class => "details", :action => "edit", :id => event)
%>
but that creates a link which looks like
/admin/events/edit/3?class=details
which is not what I''m looking for.
Kyle Heon
2005 Sep 22
5
Adding Categories to the Depot example in the Agile Rails book
Hi ya, I want to add categories to the depot example in the Agile rails
book.
These are my thoughts:
Create a new table called categories with id, title, description, and
image fields.
Add a new field to the products table called category_id
Create a model called Category with "has_many :products"
Now I should have a one to many link between the products and categories
tables?
Now
2006 Jun 08
7
The Agile Book Messageboard?
Hello.
Where is there an Agile Messageboard?
On the first part of the Depot example, a price field shouldn''t be an
integer right? (it should be more of a float since a price has decimals)
Dominic Son
--
Posted via http://www.ruby-forum.com/.