Displaying 20 results from an estimated 3000 matches similar to: "Drop down boxes from table data"
2006 May 28
3
Validating Foreign Key
Howdy,
I''m a Rails beginner working on my first significant project with RoR.
I''m trying to figure out how to validate a foreign key (you know, make
sure the row actually exists.)
However, validates_associated doesn''t seem to be what I want to use, nor
does it work...
-- BEGIN --
class City < ActiveRecord::Base
has_many :schools
belongs_to :state
2010 Feb 10
3
How to repeat the names?
Dear R helpers
I have a city.csv file as given below.
'city.csv'
city_name1 city_name2
New York City Buffallo
So I define
city_name = read.csv('city.csv')
city1 = city_name$city_name1
city2 = city_name$city_name2
My problem is how do I repeat the names one after other say 10 times i.e. my output should be like
New York
City Buffallo
New York
City
2013 Apr 02
4
gmaps4rails: undefined method `model_name' for NilClass:Class
Hi All,
just in a spot of bother with this gem, I am trying to create a new
location and get the above msg.
here is my controller:
class LocationsController < ApplicationController
# GET /locations
# GET /locations.json
def index
@locations = Location.all
@json = Location.all.to_gmaps4rails
end
respond_to do |format|
format.html # index.html.erb
2012 Nov 18
2
Question about making histogram and x must be numeric
Hello all,
I hope someone of you can help me out, I have searched other posts as well
but I can't find any solution to the problem I'm dealing with.
I want to make a histogram from the data Telephone Lines
MDGdataset <-read.csv("MDG_dataset_2010.csv", header=T)
MDGdatasetAdapted <- subset(MDGdataset, select = c(Country_Code,
Country_Name, Year,
2006 Apr 13
0
text_field_with_auto_complete and foreign characters
I need a form where the user must enter a city name. I would like to use
an autocomplete_field for the city name, so I have the following code in
my view:
<%= text_field_with_auto_complete ''entry'', ''city_name'', :size => 40 %>
and in my controller I have the method:
def auto_complete_for_entry_city_name
@cities = City.find(:all,
2011 Sep 07
6
FactoryGirl doesnt produce unique names?!
Hey,
I got following very simple test case:
require ''spec_helper''
describe Country do
it "should create a new instance given valid attributes" do
Factory(:country)
end
end
Factory looks like:
Factory.sequence :country_name do |n|
"Country #{n}"
end
Factory.define :country do |c|
c.name Factory.next(:country_name)
c.nationality "Foo
2006 Dec 09
1
WinBUGS14 and R
I'm trying to call BUGS from R. But it's not working. R freezes up and
BUGS gives me a strange output in the log. Just to know, BUGS is
registered. The modified date on the keys file is today (Dec. 9th). It
should be fully registered so that I can use it fully. And, the BUGS model
is syntactically correct. Any suggestions would be very helpful.
Here is my BUGS model:
model {
2018 Jun 01
3
Trust relationship between different domains
Hai Elias,
聽
Sorry for the late reply.
I do preffer the list, and i understand why you mailt my directly, but best is to keep this on the list.
The more eye that see this, the more chance you have on a reply.
I must say, i personaly dont use any trust relations ships. that was long ago when i used that, so im bit rusty here.
聽
Now, i see you are using my 4.8.2 packages. so you on debian. *( or
2009 Feb 12
4
Easy RoR <-> Javascript syntax question
Hi there,
a simple n00b question:
I have that Javascript snippet on my page (see below; taken from jquery,
actually).
I want to pass it the "@cities" array from the controller. But what''s
the correct syntax, here?
See the 3rd line:
========================================
<script>
$(document).ready(function(){
var data = @cities; <---- that''s
2011 Aug 24
3
ddply from plyr package - any alternatives?
Hello everyone,
I was asked to repost this again, sorry for any inconvenience.
I'm looking replacement for ddply function from plyr package.
Function allows to apply function by category stored in any column/columns.
Regular loops or lapplys slow down greatly because my unique combination
count exceeds 9000. Is there any available solution which allow me to apply
function by category?
2006 Aug 10
5
RJS in Internet Explorer to update a list box
Hi,
I''m trying some RJS to update a series of list boxes in which the user
selects a state, and the following list gets updated with a list of
counties, and the same for the next list of areas.
My code works perfectly (albeit a bit slow) on Firefox, but on Internet
Explorer it clears the list box (instead of filling it) and Netscape
shows all the counties cramped together on one
2012 May 28
4
How to load a selection list into the method new of a controller?
Hi friends!
I''m relatively new with Rails and I''m struggling for a long time with this
problem (it should have a pattern solution but until now I didn''t find it):
I have the following models: Institution, City, State and Country.
class Country < ActiveRecord::Base
has_many :states
has_many :cities, :through => :states
end
# == Schema Information
# Table
2006 Aug 16
8
Multiple (AJAX) Observers on the Same Field and MSIE
I have been using multiple observers, i.e., observe_field(), on the same
input field and relying on them to execute in the same order that they
appear in the page. This has been working fine in FireFox, but it does
not seem to work in MSIE; the requests come in and are processed in a
different order. Now, I''ve always been a little hesitant about using
this technique, but it always
2009 Oct 08
6
Eager Loading a Relationship That Has No PK/FK
I''m attempting to wrestle an old DB into Rails.
This relationship is giving me trouble:
class Show < AR::Base
has_many :segments
end
class Segment < AR::Base
belongs_to :show
has_one :media #this has no PK/FK relation
end
A Segment is "linked" to Media by Media.name, which is the result of
concatenating Segment.name and Segment.part. As I said there are is no
2006 Aug 16
0
Multiple observer
Hi
I have three drop downs (State, City, Locality) and would like to
populate
City based on State selection and Locality based on City selection.
I have observers on two fields (State, and City). The observer_field on
state
works fine and it populates city based on state selection. But the
observer
on city doesn''t populate Locality. Now sure whats wrong with my code.
here is the
2006 Aug 17
0
AJAX - Having Multiple SELECT (Drop Down), and dependency
Hi
I have three drop downs (State, City, Locality) and would like to
populate
City based on State selection and Locality based on City selection.
I have observers on two fields (State, and City). The observer_field on
state
works fine and it populates city based on state selection. But the
observer
on city doesn''t populate Locality. Now sure whats wrong with my code.
here is the
2010 Jul 15
3
aasm manage states
Is there a way to manage the states in AASM by keeping them in a table
to normalize the data?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
2018 Jun 04
0
Trust relationship between different domains
Hai Elias,
NET USE \\10.10.1.7\IPC$ /user:campus\administrator pa$$wd
Works! :)
C:\>net use
Novas conexões serão lembradas.
Status Local Remoto Rede
-------------------------------------------------------------------------------
E: \\vboxsrv\D_DRIVE VirtualBox Shared Folders
OK \\10.10.1.7\IPC$
2011 Jan 02
6
Database Design
Hello,
I have a user table that stores their username, email address, and
password. (along with salt, etc)
However, now I want to have more complex information associated with
each user (address, etc). I''m no DBA expert, so in terms of
performance, which is better:
- A user table that has all the fields in it (Username, Email,
password, country, state, zipcode, etc)
- A user table that
2006 Apr 25
4
belongs_to :through
belongs_to :through
Why is that not possible?
We should have:
Street
belongs_to :city
belongs_to :country, :through => :city
--
Posted via http://www.ruby-forum.com/.