Displaying 20 results from an estimated 400 matches similar to: "Cucumber+Capybara rails 3 issue (Don't know where exactly)"
2006 Aug 16
4
Undefined method - what undefined method
I am doing a typical database list, but when I do
<% for m in @private_messages %> (Line 28) It tells me that the method
''each'' is undefined. What''s wrong, I did not call the method each....
Here''s the error:
Showing app/views/account/mail.rhtml where line #28 raised:
undefined method `each? for #<PrivateMessage:0x408bb830>
Extracted source
2006 Jul 13
5
ActiveRecord inheritance
How to create a super class based on ActiveRecord::Base?
For example:
class ParentRecord < ActiveRecord::Base
end
class ChildRecord < ParentRecord
end
Rails always asks for ''parent_records'' table. Which has absolutely no
need to exist at all. It''s intentionally made as a super class to be
inherited.
Thanks.
--
Posted via http://www.ruby-forum.com/.
2012 Feb 18
6
rake db:reset doesn't work, fails with unknown attribute: user_status
If I manually drop the database, and run create, then migrate it works fine.
But doing a:
rake db:reset
it fails with:
unknown attribute: user_status
Does this mean my migrations are not dropping things correctly?
--
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
2007 Nov 05
0
Authentication: is a guest a user or an "exception"?
Hi all
I''m currently implementing authentication/authorization in my app. Now
I''m wondering what''s the common way to handle a guest...
In fact, many of the visitors of my app will be anonymous users that
just want to read articles etc., but one can register as a member to
have some further possibilities. So far one can login as a member and
from this point on one has
2006 Jul 24
3
Newbie Q: How to creat 2 classes
Hi,
I am very new and still learning and I am not sure how to start
this...could someone show me some code or give some hints...I want to
creat to classes so there will be admin users and regular users in a
login system.
Thanks in advance...
adam
--
Posted via http://www.ruby-forum.com/.
2006 Jan 18
6
Using conditions in ActiveRecord
This bit of code finds several groups; all those which have
entity_id''s of ''1'' OR ''2'' OR ''3'', as you would expect:
ee = [ 1, 2, 3 ]
groups = Group.find(:all, :conditions => "entity_id in (" + ee.join
(",") + ")")
But this bit of code only finds groups which have entity_id''s of
2005 Mar 04
3
optimization
Ok, so, I''ve written my first app in rails. It''s pretty nifty. Only
one problem. Slower than you could possibly comprehend.
Processing PersonController#show (for 67.138.254.231 at Thu Mar 03
21:04:16 Eastern Standard Time 2005)
Parameters: {:id=>"1", :controller=>"person", :action=>"show"}
[4;35mPerson Load (0.219000) [0;37mSELECT
2010 Jun 08
3
partial matches across rows not columns
Hi R users,
I am trying to omit rows of data based on partial matches an example of my
data (seal_dist) is below:
A quick break down of my coding and why I need to answer this - I am dealing
with a colony of seals where for example A1 is a female with pup and A1.1 is
that female's pup, the important part of the data here is DIST which tells
the distance between one seal (ID) and another
2006 Jan 31
4
has_one without inverse belongs_to
I have two models called entity and user.
The entities table has a column called users_id that contains the user
id of the user that created the entity.
In entity I have...
has_one :user
... as I want to be able to show the user who created the entity from
the entity object.
But this produces the following error...
Mysql::Error: #42S22Unknown column ''users.entity_id'' in
2007 Jan 03
3
Self-referential habtm with condition is broken
Here''s a simplistic model class.
class Person < ActiveRecord::Base
has_and_belongs_to_many :relatives,
:class_name => ''Person'', :join_table => ''relatives'',
:foreign_key => ''from_id'', :association_foreign_key => ''to_id''
has_and_belongs_to_many :brothers,
:class_name =>
2006 Jan 28
13
What''s the verb form of id?
Random question:
I''ve written a method for the String class that turns an arbitrary
line of text in to an identifier, e.g.:
"My, what a beautiful day!"
=> "my_what_a_beautiful_day"
"(anb*#NF(AMNV"
=> "anb_NF_AMNV"
We''ve got all these great names already like underscore, classify,
titleize and things like that. I''d
2007 Feb 12
2
Objects in Arrays? Allowed, right?
Hi:
I''m trying to manually append objects to an instance variable that is
just an array of objects. Here''s my controller code:
@tasks = Task.find(:all, :conditions => "entity_id =
#{session[:user].id}")
for t in @tasks
if Subtasks.find(:first, :conditions => "child_id = #{t.id}") != nil
@mtasks << t
end
end
However, when I execute, I
2009 Feb 15
3
conditions on association include, hacky but more or less solved
Hi all,
I just finally figured out how to get 2.2.2 to do this, and thought
I''d share in case others run into the same thing.
The situation is a find with associations, but the tricky part is that
the association shouldn''t always be loaded. This is similar to putting
a condition on a has_many association in a model, but the condition is
dynamic rather than predefined.
The
2003 Sep 25
2
sshd (openssh 3.7.1p1) dies during login on Solaris 8 system with SRM installed
I have compiled ssh 3.7.1p1 using gcc and am trying to get it to run on our
Solaris 8 systems running Sun's SRM system.
With existing users it is fine, but with a new user, the user can not ssh in
on the first login, they get the message from SRM that no lnode has been
created.
I put sshd in debug and found that it SEG's here:
debug3: mm_sshpam_free_ctx: waiting for
2006 Aug 14
1
2 foreign keys to one table
Hi,
I have a messaging class that has to relationships to one table
belongs_to :user, :foreign_key => "from_id"
belongs_to :user, :foreign_key => "to_id"
At the min I can specify message.user.login and it will return the
username of last relationship to that table.
how can I get it to bring back both references
ie message.from.login and message.to.login
thanks
scott
2010 Jun 01
2
storing output data from a loop that has varying row numbers
Hi All,
I am trying to run a loop that will have varying numbers of rows with each
output.
Previously I have had the same number of rows so I would use (and I
appreciate that this will no doubt achieve some gasps as being thoroughly
inefficient!):
xdfrow<-(0)
xdfrow1<-(1:32)
xdfrow2<-(33:64)
xdfrow3<-(65:96)
xdfrow4<-(97:128)
xdfrow5<-(129:160)
xdfrow6<-(161:192)
2002 May 06
3
Viewing certain numbers without NA's
Dear R Community,
We have recently installed R 1.5.0 on several workstations. Ever since,
if I try to extract certain numbers or lines from a file (which contains
many NA's), I don't only get my desired line but all other lines which
contain NA's. In a file with 15000 rows and 7500 NA's this is not very
practical. In the earlier R-Version this worked when I typed in the
2014 Jul 02
1
Webrtc Not acceptable here
Hi,
I am getting
*Can't provide secure audio requested in SDP offer*
with sipml5 client hosted on my local system
[1060] ; This will be WebRTC client
type=friend
username=1060 ; The Auth user for SIP.js
host=dynamic ; Allows any host to register
secret=sameer ; The SIP Password for SIP.js
encryption=yes ; Tell Asterisk to use encryption for this peer
avpf=yes ; Tell Asterisk to use AVPF
2012 Oct 01
1
active_model_serializers, more than one level deep of associations, specifying serializers per association
I am assuming this an appropriate place to discuss this, but if it isn''t my
apologies- just let me know. Just a Rails 4-ish thing.
Am attempting to pull AMS (active_model_serializers), strong_parameters,
and the "permitter" strategy that Adam Hawkins is using:
http://broadcastingadam.com/2012/07/parameter_authorization_in_rails_apis/
Code so far is here (in the
2006 May 16
9
Array in database?
Hello, I wanted to know how to make an aray in the database. I''m making
a "backpack" for my game. So i''m gana use it in a array.
--
Posted via http://www.ruby-forum.com/.