Displaying 20 results from an estimated 100 matches similar to: "Unexplainable failure...at least for me"
2008 Dec 23
1
aggregate / tranpose data
Dear R-Users,
Suppose I have data in the following format:
CODE_NAME ZIP_CODE
John 12345
John 23456
John 34567
Jane 13242
Jane 22123
I want to transpose / convert it into:
CODE_NAME ZIP_CODE
John 12345,23456,34567
Jane 13242,22123
Any idea/pointer is appreciated.
2006 Mar 30
3
Rails 1.1, Markaby, options_from_collection
Last night, I upgraded one of my rails apps to 1.1. This app uses
Markaby exclusively for its'' views, and once I checked out the latest
revisiong of Markaby (r33), everything was working fine except for one
thing:
select_tag(''province_id'', options_from_collection_for_select(@provinces,
"id", "name"))
Now returns this (as you see it is spitting
2010 Apr 09
1
Dovecot 1.2.11, Quota and SQL
Hello,
I have a problem :(...
I try to define User Quotas in Dovecot (in my DB mySQL) but default
quotas (in my dovecot.conf) are always set for all users.
I've defined default quota to 500M. I set 0 to one account in my DB but
when i see my logs, this account have a 500M quota !
Could you help me ?
My configuration :
# 1.2.11: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.18-xenU i686
2010 Aug 19
1
Composite primary keys and :joins=>
I have a legacy db with the following simplified structure:
Table-A:
type_key, code_key, name, ... # PKs are type_key and code_key,
there is no id col and I cannot alter this db
Table-B: # each row has only the code as a foreign_key, the type_key
is hard-coded to "FOOKEY"
an_id, code, ...
Models:
class TableB < AR::Base
set_table_name ''table_b''
2010 Nov 09
3
help getting started with javascript generated forms
How does one generate a form within a view using javascript?
Specifically, assume views/premise/new.html.erb looks like this:
<%= form_for(Premise.new) do |f| %>
<%= f.hidden_field :full_address, :value => $FULL_ADDRESS %>
<%= f.hidden_field :geocoding, :value => $GEOCODING %>
<%= f.submit :value => "use this address" %>
<%= f.label
2006 Jul 18
1
Need Help Updating Records
This is a stupid question I know, but it is driving me crazy - I am
missing something simple and basic here. I am trying to update missing
zip codes on a data table. I am doing something incorrectly as the data
in the Source table is not being updated, only the value in the array is
changed. How do I get this to update the actual DB record instead?
def add_missing_zips
#find all records in
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
2007 Oct 26
5
specing rescue, ensure and else blocks of an Exception
Greetings,
I''m using rspec with rcov for my applications and there is one issue
which I cannot solve nor can find any proper information regarding
it: specing what is in a rescue block in case of an exception.
I''m using Ruby on Rails and I usually make use of exceptions in my
controllers, like the following example:
def action
@foo = Foo.find(1)
2006 Jun 16
0
Getting error on a group select
Hi,
I''m very new with Ruby and Rails. I have read Agile Web Development
with Rails and was trying to create a grouped selection list by
following his example on page 359.
My helper looks like this:
module LoginHelper
AssocOption = Struct.new(:code_name, :display_name)
class AssocType
attr_reader :type_name, :options
def initialize(name)
@type_name = name
2006 Jun 16
0
Getting an error on options_groups_from_collection_for_select
Hi,
I''m very new with Ruby and Rails. I have read Agile Web Development
with Rails and was trying to create a grouped selection list by
following his example on page 359.
My helper looks like this:
module LoginHelper
AssocOption = Struct.new(:code_name, :display_name)
class AssocType
attr_reader :type_name, :options
def initialize(name)
@type_name = name
2010 Mar 26
7
seed data
Hi
I am using seed_fu to seed initial data to tables
(http://github.com/mbleigh/seed-fu) . And in db/fixtures/state.rb
I have values like (I am filling only two data for simplicity)
State.seed_many(:name, :abbr,:fips,:country_id, [
{ :name => "Alberta", :abbr => ''AB'',:fips => ''01'', :country_id =>
2 },
{ :name =>
2009 Jan 28
3
Apply style in collection_select ?????
Hi to all,
i have this snip i want to apply style to this combo but there is no
effect
help.......
<%= collection_select(:customer,:country_id, @countries,:id, :country,
html_options={ "style" => "width:110px" },:onchange =>
''updateState('''');'',:id =>''country_id'' )%>
Thanks,
--
Posted via
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
2008 Jan 29
0
ActionMailer calling shared methods
I''m trying to use a shared method from an ActionMailer template. The
method was originally in ApplicationHelper, but I''ve also tried it in
the base controller (application.rb), with and without
helper_method. In all cases, I get an error
undefined method `wgg_replace_crlf'' for #<ActionView::Base:0x324b230>
Here is the relevant block of code from the email
2008 Jul 07
0
ActiveRecord in Rails 2.1.0 misbehaving for Aggregate Attr.
I am not sure if this is a bug in ActiveRecord or is this the intended
behavior. If it is then it does not make sense to me.
In a nutshell: If you change an aggregate object attribute created via
composed_of method (see Agile Web Development - Second Edition Chapter
17 page 313 onwards) and then save the model, the change to the model
(composite attribute specifically) will not be saved UNLESS
2010 Nov 09
2
Undefined method
I am very new to ROR. (Ruby 1.8.7, rails 2.1.1, rack
0.8.7, mysql 5.1.41)
I has my_app/lib/migration_helpers.rb file:
module MigrationHelpers
def self.foreign_key(from_table, from_column, to_table)
constraint_name = "fk_#{from_table}_#{to_table}"
execute %{alter table #{from_table}
add constraint #{constraint_name}
foreign key (#{from_column})
2007 Dec 11
3
can''t access helper methods for model testing
I would like to have some valid mock models readily available in the
helper module, but when I try to access the helper I get the error
saying that the method is not found.
=======
describe MembersHelper do # Helper methods can be called directly in the
examples (it blocks)
def valid_member_mock
member = mock_model(Member)
member.stub!(:first_name).and_return("Joe")
2012 Nov 17
2
Help needed for error in foreign key validation
I have two models bank and country. User should only associate a Bank with
a country id present in the country table and I put validates presence of
country to enforce it but i get error mysql2::Error: Unknown column
''countries.bank_id'' in ''where clause'': SELECT `countries`.* FROM
`countries` WHERE `countries`.`bank_id` = 17 LIMIT 1 when updating the bank
2006 Jul 28
3
Forms: handle foreign keys (AssociationTypeMismatch)
Hi all
I tried and tried and tried, but I still fail in creating a form with
proper validation and stuff for foreign keys... So I''d really like to
get some help here.
I''m creating a booking site for DJ''s, and for every booking one can
choose one of different countries:
class Booking < ActiveRecord::Base
validates_presence_of :country_id
2006 Apr 06
0
3 doubts on observe_field
Dear friends, with the yours aid already I obtained to use
observe_field, but still I am with some problems and necessary again.
They are three questions to long of the source code below.
Since already I am grateful for the tips.
==== _form.rhtml
<!--[form:city]-->
<p><label for="city_state_country_id">Pa?s</label><br/>
<select