Displaying 20 results from an estimated 8000 matches similar to: "updating records in a many-to-many relationship"
2006 Jul 29
1
creating and storing records in Ruby
I''ve read through my RoR books and I can''t seem to find the solution.
This is a pretty basic, easy, and practical application for RoR. If you
guys know of any resources on the net to answer these questions let me
know.
Question 1:
Basically, I have a many-to-many relationship that I want to add records
to. I use something like this to add records in the A_B table:
2006 Jul 27
2
Saving records in mySQL for many-to-many relationship
Hey guys,
Maybe someone could point out what wrong here. I''ve simplified the issue
to this:
Both User.find(6) and Sport.find(1) exist, Im just trying to setup the
relationship between them.
My controller looks like this
def tester
@c = User.find(6)
@c.sports = Sport.find(1)
end
And I keep getting this error:
undefined method `each'' for #<Sport:0x36a3488
2006 Jul 29
2
Finding sum
# Get a list of product ids from a form, then
# sum the total price
product_list = params[:product_ids]
total = Product.find(product_list).sum(&:price)
I understand the first list line and part of the second line, but what does the & symbol mean?
TIA.
2006 Apr 20
7
Rails + postgres case insensitive searches.
Hello all
I am wondering how rails handles case sensitivity in databases. If I
do a Person.find_all_by_name("tim") in mysql I would expect to get
tim, TIm, and Tim. Do I only get tim in postgres?
How do other people deal with this? Do you resort to find_by_sql for
all your postgres queries to get case insensitive results?
2005 Mar 10
2
NoMethodError in Event_type#create
I am new Ruby on Rails, so excuse me if my question seems pretty obvious.
I am trying to validate uniqueness of a filed:
class EventType < ActiveRecord::Base
belongs_to :sport
validates_uniqueness_of :event_type
end
When I run it, I get this error message:
Showing /event_type/new.rhtml where line #27 raised undefined method
`each'' for nil:NilClass
<select
2006 Nov 29
4
how do I model self-referential entities?
Hi all -
I am having some trouble figuring out how to model self-referential
entities in Rails.
I have a "group" model, which can have 0 or more "group" objects or 0 or
more "user" objects.
I tried creating a subgroup table that has a parent_group_id and a
child_group_id as foreign keys but can''t figure out how to create the
mapping in my ruby model
2008 Jul 08
3
undefined method `name' ...........
Hi Community....
I''m new in this game, so this might be a easy question, but I have
done my google, without result, so I will try this....
I''m learning ROR, and I''m using Patrick Lens ''Ruby on Rails'' book.
(This is written for ror 1.x - and I''m using NetBeans 6.1 - ror 2.x -
this might be the problem...)
But...
I have made this
2008 Apr 15
2
How can I import user-defined missings from Spss?
Hi,
It works for me to import spss datasets via library(foreign) with read.spss or via library Hmisc by (spss.get).
But no matter which way I do import the data, user-defined missings from Spss are always lost.
(it makes no difference if there are a single value, a range, or any combination of them. They are always ignored).
Is there any way in R to find out if any value was user-defined missing
2007 Feb 13
1
observe_field and select box
Hi everyone,
I am a newbee in RoR and i could use some help. I have a select box
populated by:
<select name = "test_company" id = "test_company">
<option selected value=test.company.to_s>Create New </option>
<%= options_for_select Company.find(:all,
:conditions => ["name =?", test.company],
:order => "id asc").collect{|c|
2006 Jul 28
7
auto_complete_for exists but not being found by Rails
Anybody encounter this. I know the method exists in the auto_complete.rb
file in my rails installation, but it itsnt accessing it throught he
program.
Any ideas?
--
Posted via http://www.ruby-forum.com/.
2006 May 14
3
Strange Database Mapping Question
Dear Rails List,
I am new on the list so will assume straight away that this question has been
answered before. As I can see no immediate way of searching the list, I will
ask the question. I apologize in advance for any disruption this may cause.
Question time:
I am trying to write a web application for the staff at my office to play a
form of virtual Super14. Its a bit like any of the
2019 Oct 01
3
SquidGuard update in EPEL
Le 30/09/2019 ? 17:53, Gwaland a ?crit?:
> looks like it was updated due to a segfault.
> https://bugzilla.redhat.com/show_bug.cgi?id=1750550
> https://bugzilla.redhat.com/show_bug.cgi?id=1253662
Now I'm even more puzzled.
Fedora and EPEL sport SquidGuard 1.4.36.
Now when you search for "squidguard", this seems to be the project site:
* http://squidguard.org/index.html
2006 Sep 09
1
options_from_collection_for_select
I''ve looked at the API on this but can''t quite see what I''m missing from my call
<select id="pay[pay_id] name="pay[pay_id]">
<%= options_from_collection_for_select(
Pay.find_all_by_name, "id", "name") %> #<- line 5
</select>
is returning -
Showing app/views/kr/index.rhtml where line #5 raised:
wrong number
2006 Aug 02
4
applying conditions to ActiveRecord call in model.rb
If @c is an instance for the User class and lets say I want to call
@c.pictures, which would be the user''s pictures.
How can I setup up RoR so that I could append the condition
"status=''available''" to the conditions arguments EVERYTIME .pictures is
called. This way I can only call available pictures
Is there some kind of filter I can apply to the
2006 Aug 08
8
RESTful Rails Plugin
I am following the instructions on how to use RESTful Rails plugin found at
http://www.xml.com/pub/a/2006/04/19/rest-on-rails.html?page=3.
When I run the rake test:functionals
I get the following error message:
rake aborted!
undefined method `first'' for :book:Symbol
(See full trace by running task with --trace)
How can I fix this problem? I am using Rails 1.1.4 version. TIA
2008 Nov 24
3
Is this correct?
I have to answer the following question for a homework assignment.
A researcher was interested in whether people taking part in sports at
university made more money after graduating, taking into account the
students' GPA. They sampled 200 alumni from a large university. The
variables are: income (income 10 years after graduating), sports (1 if they
did sports, 0 if they did not), and GPA (the
2015 Aug 31
2
alloca combining, not (yet) possible ?
Caldarale, Charles R schrieb:
> You have not provided us with the declaration for f(). Unless its argument is marked with the nocapture attribute, the compilation of g() cannot assume that f() has not retained a pointer to the x struct and is using it in the second call.
>
thanks a lot for the input. Yes, I forgot to that. The C function
declaration would have been
void f( struct a_b
2015 Aug 31
2
alloca combining, not (yet) possible ?
Hello
since my broad RFC request didn't catch any responses, let me get a bit
more into the nitty-gritty:
I tried to get llvm (3.7) to optimize superflous allocas away, but so
far I haven't figured out how. Is there no optimizer for this ? Should I
adorn something with some attributes ? As far as I can tell no, but I am
no llvm expert...
For what I want to do, i will probably have a
2012 Feb 14
3
Wildcard for indexing?
Hi,
I'd like to know if it is possible to use wildcards * for indexing...
E.g. I have a vector of strings. Now I'd like to select all elements
which start with A_*? I'd also need to combine that with logical operators:
"Select all elements of a vector that start with A (A*) OR that start with B (B*)"
Probably that is quite easy. I looked into grep() which I think might
2008 Nov 23
3
Try to run Football Manager 2009
Hello all,
I'm trying to run Football Manager 2009 under Wine.
I installed the application; But see what's happening.
wine fm.exe
err:service:validate_service_config Service L"Macsvmgbbsbs" has an unknown service type
err:service:scmdatabase_load_services Invalid configuration of service L"Macsvmgbbsbs" - skipping
fixme:actctx:parse_depend_manifests Could not find