Displaying 20 results from an estimated 3000 matches similar to: "Unknown column 'quotes.organisation_id' in 'where clause': SELECT * FROM `quotes` WHERE (`quotes`.organisation_id = 1036)"
2006 Jun 08
9
find :order =>
Hi,
I have the following find statment
@client_pages, @clients = paginate :clients, :per_page => 20, :order =>
"organisation_id, surname"
currently im ordering by organisation_id however I need to order by the
field in the organisation table organisations.name
how can this be done?
Thanks
Scott
--
Posted via http://www.ruby-forum.com/.
2006 Jan 06
6
NewbieQ: How do I refresh view after return from popup window
Hi,
I have this bitta code that is supposed to open a new window and allow
the user to create a new Organisation on the fly whilst editing a new
Person i.e. if the Organisation exists they can select it from the drop
down select. Otherwise they can click on the cute button and enter a
skeleton Organisation record. What I need to do next is refresh the drop
down select on returno the new
2009 May 14
3
Mysql query is not working
Please,
Can anyone help me to execute this query?
SELECT * FROM table WHERE customer_id IN (SELECT IF(1 <> 2,''SELECT
customer_id FROM customers'',''SELECT customer_id FROM company''))
Regards...
--
Posted via http://www.ruby-forum.com/.
2006 Jun 27
1
find (ordering by field in related table)
Hi,
I am using the rails find command as below
@project_pages, @projects = paginate :projects, :per_page => 20,
:conditions => "clients.organisation_id = " +
params[''search''][''organisation_id''],
:joins => ''inner join clients ON clients.id = projects.client_id''
There seems to be a problem with project.id being over written
2010 Feb 01
3
validating both sides of a has_one relationship breaks pickle/machinist tests
A lot has been posted about validation issues with associations,
however, I don''t see this issue addressed specifically.
ex:
class Foo
has_one :schedule, :dependent => :destroy
validates_presence_of :schedule
class Schedule
belongs_to :foo
validates_presence_of :foo_id
this creates a circular dependency that breaks test frameworks like
pickle and machinist.
At first I was
2010 Aug 16
8
Executing js.erb file with :format =>'js'
Hi, I''m trying to get my javascript to execute after clicking a link on
my page using :format => "js" here''s my link:
<%= link_to image_tag("/images/icons/user_add.png"),
add_contact_path(:profile_id => profile.id, :url => request.url, :format
=> "js"), :title => "Add person to your contacts"%>
in my controller i have
2008 Mar 28
2
Wrong story step running
Hi
I have three steps like this:
Given ''a user called "$name" of type $user_type and status $user_state in
organisation "$organisation_name"'' do |name, user_type, user_state,
organisation_name|
$runs ||= 1
puts "MOO #{$runs}"
$runs += 1
# ...
end
Given ''a user called "$name" with username
2010 Oct 19
33
Render partial generate unwanted spaces
Hello, I have a problem with the render :partial method in all my
rails webapplications. I noticed that using render :partial will
generate spaces (mainly top spaces) on the elements inserted.
As all my websites are seperated by module (basicaly header, content,
menu, footer) it''s quite a problem as I have to set negative margin-
top to various parts for the site to display as expected
2010 Dec 07
10
Advice on data design idea
I''m about to embark on a project and am seeking advice on my approach.
I have an automotive site that needs to have shared categories. I''ve
checked out different nested set, ancestral, acts_as_tree, acyclic
plugins but feel they don''t exactly fit.
So I am about to roll my own simple solution. Any feedback as to
whether this looks good is appreciated.
Essentially I
2006 Apr 26
6
get foreign key table data
Hi
I?m trying to bring across all related data.
My table clients has a foreign key field that stores the id of an
organization
How can I grab the details of the organization to use in the clients
show.rhtml file?
Thanks
Scott
--
Posted via http://www.ruby-forum.com/.
2010 Apr 25
2
Ruby randomly converting quotes to html
If anyone understands:
def some_method
"<script type=''text/javascript''>
whatever(''element'');
</script>"
end
=>
<script type="text/javascript">
whatever(‘element’)
</script>
Any idea what could create that strange behavior?
--
Posted via http://www.ruby-forum.com/.
--
You received
2010 Mar 04
25
how to share variables in data migrations (up/down)
hi there,
How do we share variables in a given data migration?
For example,
the code below fails to work because "statuses" don''t seem to be in
scope for both up and down.
class AddDefaultValuesToStatuses < ActiveRecord::Migration
statuses = [
{
''details'' => ''details'',
},
{
2006 Nov 06
2
comparing 2 dataframes
Een ingesloten tekst met niet-gespecificeerde tekenset is
van het bericht gescrubt ...
Naam: niet beschikbaar
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20061106/756382a8/attachment.pl
2010 Oct 15
18
Newbie - Rails 3 lightbox?
Hello!
I''m trying to create a simple image "popup" effect using Lightbox2,
http://www.huddletogether.com/projects/lightbox2/. But I don''t get it
to work. My code looks lite this:
<span class="ad_image">
<a href="<%= ad.image.url(:thumb) %>" rel="lightbox"><img src="<%=
ad.image.url(:thumb) %>"
2007 Feb 28
5
How to use find_options in multi_search
Hello everyone,
I''m using multi-search to search in some attributes of two classes. One
of the attributes is the id of the customer. For each multi_search I
want to do a give the id of the current customer as a parameter. This
should only return results for the given customer.
My current code looks like this:
Folder.multi_search(@search_query, [Myfile])
I noticed in the API you can
2006 Jul 25
2
Authentication design/ideas
Hi all,
I''m using acts_as_authenticated for the front end facing part of my
site. I have a model called Customer. I now want to protect the admin
sides of things. I am thinking of using Ezra''s acl plugin
(http://opensvn.csie.org/ezra/rails/plugins/dev/acl_system2/README)
for this. My only problem is that I don''t want the model for admin
users to be called Customer,
2007 Jan 08
1
Realtime Voicemail Table Column Name Question
Hi All,
In the realtime voicemail table the column 'customer_id' is used, for
my purpose, to specify the customers accountcode. The column name
'accountcode' is used in the iax and sip tables. To keep this
consistent throughout the tables, is there any reason I should NOT
switch the column name 'customer_id' to 'accountcode' in the voicemail
table? Does Asterisk
2007 Mar 07
4
Strange Problem With Unwanted, Transient Caching
Hello,
I hope somebody can explain to me what''s going on here because I''m
baffled!
In a controller''s action I want to create a new order for a
customer. Because I post back to the same action (not RESTful I
know, but that''s for another day) I use code like this:
def edit
@order = Order.find_by_id(params[:id]) || Order.new
...
end
I
2006 Feb 27
3
Newbie Question
Hi! I just ran the first few Rails tutorials and I''m really impressed
at how quickly I was able to get something up and running.
I''m slowly emerging from the stone ages, and leaving my powerbuilder
behind ? yes, I know, keep the snickering to a minimum please! I
started into J2EE/STRUTS, but was quickly frustrated by how long it
would take to code anything but relatively
2011 Apr 01
4
add_column not working in migration for sqlite3
Hello,
I developed an app with postgres DB but want to change the DB to
sqlite3. I changed the database adapter in the database.yml file. When I
run the migration most of it was successful but add_column was throwing
an error
"Cannot add a NOT NULL column with default value NULL: ALTER TABLE
"rates" ADD "customer_id" integer NOT NULL".
I made the modification and