Displaying 20 results from an estimated 1000 matches similar to: "Finding the rhyme for has_many :through"
2006 Jan 04
1
[SOLVED] Am I going too far or Rails is just confusing?
On 1/4/06, John Indra <ji.milist@gmail.com> wrote:
> However, it doesn''t work for me. Following your article, I change my
I have found the source of the problem. I follow the solution provided by
http://blog.teksol.info/articles/2006/01/03/belongs_to-user-interface-take-ii
It''s a nice solution, however it contains typo :)
There is indeed no error_messages_on method,
2006 Mar 18
3
Nil result on find & pretty print
I am new to Ruby and to Ruby on Rails and have spent the last few days
trying to get my head around it. I think I am already hooked but am
suffering badly from years of programming a non-OO RDBMS. I am trying
to learn by attempting to produce a system for my work.
I have a main table sdocs which has a field supplier_id which is an
entry in another table (suppliers) to lookup supplier name etc.
2006 Jan 03
6
Am I going too far or Rails is just confusing? was {validates_presence_of *_id attributes}
Thanks for the input Blair Zajac and Chris (Nolan and Hall), and for others.
If all of you have time, please follow this (the question still
relates to the previous posts by me):
I have provided full steps to reproduce the symptoms.
If it matters, I''m running Ruby 1.8.2, Rails 1.0, and MySQL 5.0.15 on
Windows XP Professional.
1. First, the setup
MySQL
-----
create database testdb;
2006 Jan 03
4
validates_presence_of *_id attributes
Hi all,
I am a newbie to Rails. Please enlighten me on how to do this
appropriately, the Rails and the Ruby way:
Suppose I have a Recipe model. Let''s simplify things and pretend that
it has only 2 attributes, a :name and the other is a ''category_id''. In
the recipes table, category_id is a foreign key to field id of table
categories.
We also assume that I have generate
2007 Apr 04
4
Order a find using a has_many association
I''m trying to order a find through a has_many association. I have a
model called SalesOrder. Each sales order has things like amount,
description, etc. I use the following to get the Sales Orders:
@sales_orders = SalesOrder.find(:all)
And I display them with:
<td><%= link_to sales_order.id.to_s, :action => ''show'', :id =>
sales_order.id
2007 Jan 16
2
Specifying the contents of a date selector
Another n00b question (can you tell I don''t normally write view code
yet???)...
I''m using the date_select form helper to give me three select popups,
(day, month, year). I want to specify that these exist and are set
to today''s date
I''ve tried this:
response.should_have ''form > p > select
2009 Mar 17
1
Route failure with Rails2.3 and rspec1.2
Hello all,
I have a spec for a route that used to pass under Rails 2.2.2 and rspec
1.1.12, but can?t figure out what is wrong since I updated. Here is the
assertion:
route_for(
{
:controller => ''purchase_orders'',
:action => ''update'',
:company_id => "32",
:id
2006 Mar 13
8
Nested find(:all, :include => ) statements
Is there a way for me to do:
OrderItem.find(:all, :include => [:user, :product => [:supplier]]
So I don''t have a supplier_id on my order_item, but have it on my
product, which is part of order_item.
Joerg
--
Posted via http://www.ruby-forum.com/.
2007 Mar 22
2
Inconsistent Invalid Argument Error
I have a view with a table that contains sortable links as headings.
Here is the code used to create these sortable links in the
application_helper:
module ApplicationHelper
def sort_link_helper(text, param)
key = param
key += "_reverse" if @params[:sort] == param
link_to(text, :controller => ''sales_orders'', :action => ''list'',
2011 Dec 21
8
Any rhyme or reason to disk dev names?
Hello,
I am curious to know if there is an easy way to guess or identify the
device names of disks. Previously the /dev/dsk/c0t0d0s0 system made sense
to me... I had a SATA controller card with 8 ports, and they showed up with
the numbers 1-8 in the "t" position of the device name.
But I just built a new system with two LSI SAS HBAs in it, and my device
names are along the lines of:
2004 Mar 24
2
slow to drill into directories
I have a samba server configured at a clients office and sometimes when
he is drilling down into directories in his "File Explorer" it stalls. I
tail'ed the log files and I ran tcpdump, but I can't see anything that
stands out. What should I look at? I am running Samba Version 2.2.3a-12.3
for Debian.
brian
--
Brian Lavender
http://www.brie.com/brian/
2005 Sep 22
6
Autocomplete - setting a second value?
I''m using the autocomplete function, and need a way to grab a second
value from the ajax request... an example would probably speak better:
This is my HTML:
<input name="CustomerName" id="CustomerName" type="text" />
<div id="CustomerList"></div>
<input name="CustomerID" id="CustomerID"
2007 Nov 05
6
Strange wildcard problem
Hi,
Apologies for reposting this for those who read this via ruby-forum,
but it didn''t make it to the list before, and the list seems more
active...
I''m using ferret (via acts_as_ferret) in a somewhat unorthodox
manner and am having a strange wildcard problem. Before anyone wonders
why we''re doing things this way, the answer is basically that it lets
us
2003 Jul 23
1
Samba 3.0 beta 3 issues
Hi there,
I'm using Samba 3.0 beta 3 on RH 9 (connecting to a Windows 2000 domain,
as a member server) and I'm having trouble keeping samba running
reliably. At random times it seems to stop recognising names from the
domain. Restarting winbind fixes the problem, but then it occurs
randomly again, usually once or twice a day. At least once it has fixed
itself after being broken overnight
2002 Sep 07
2
Can't access samba server from windows
Dear all,
I've already install new samba 2.2.5 at Redhat 7.3.
Some configuration of smb.conf has been tested using
testparm and no error return. Using LinNeigborhood I
can access some files and folders of windows PC. But
from windows I can't access samba directories and
files. Error report from windows is Network path was
not found. Lan connection is ok if test ping.
Can you suggest me
2006 Jul 11
5
What are people using for date fields
I''m just curious about what techniques others have successfully used to
capture date data on forms as an alternative to the standard date_select. I
have to admit I''ve been lazy and only used the date_select as we have very
few dates in our system now, but that is about to change. I would like
something better.
Any thoughts?
--
Thanks,
Sam
-------------- next part
2008 Jul 22
5
RJS opener.reload()
Hello,
I have a problem with RJS.
I have a popup and by pressing a button within it I want to:
1. close this popup, which functions fine with onClick in the view and
2. reload the opener page of the popup after the called action in the
controller is done.
I tried:
render :update do |page|
page.opener.location.reload()
end
in the controller, but this didn''t work.
Can anyone
2003 Jul 11
2
Join linux to win Nt pdc
dear milist
i'm newbie , i try to join my linux box to win nt pdc , i try follow
documention in samba.org but still not working
here the conditional of my server .
server win nt PDC = 192.168.0.1
linux workstation = 192.168.0.10( linux mandrake 9.1+ samba )
in win nt PDc have been add win nt workstation with name linux ( linux ws)
here my samba.conf
[global]
netbios name = linux
2006 Jul 16
3
Binding text_field et al to object.attribute.name
Hi all,
Suppose I have a PurchaseItem model which refers to Product model...
class Product < ActiveRecord::Base
has_many :purchase_items
end
class PurchaseItem < ActiveRecord::Base
belongs_to :product
end
To keep things simple, one of the attribute of the Product model is
title.
On the interface, I have a textfield that I need to bind with
@purchase_item.product.title.
2006 May 25
3
Name of action inside template
Hi all,
How do I know the name of the action currently invoked inside RHTML
template?
I need to make a text_field readonly when the action is ''edit'' and
readwrite when the action is ''new''.
Tq,
John