similar to: a rails model question

Displaying 20 results from an estimated 1000 matches similar to: "a rails model question"

2006 Mar 12
0
NameError when trying to combine Recipe 14 (rich HABTM) & Rec. 10 (self-ref HABTM):
Hi all, I''m trying to model self-referential relations between people, where the relation has attached data. John ''works for'' Bob Problem: '':through'' doesn''t work, and generates a NameError. => the models : Person (attr: name) Relation (attr: source_id, target_id) (more details below) ex: John ''works
2011 Jan 19
6
rake aborted! can't convert Hash into String
Hello, I encouter a problem when i try to do "rake db:migrate": rake aborted! can''t convert Hash into String Here is the trace result: ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment rake aborted! can''t convert Hash into String /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1408:in
2012 Nov 05
25
[PATCH] IOMMU: don't disable bus mastering on faults for devices used by Xen or Dom0
Under the assumption that in these cases recurring faults aren''t a security issue and it can be expected that the drivers there are going to try to take care of the problem. Signed-off-by: Jan Beulich <jbeulich@suse.com> --- a/xen/drivers/passthrough/amd/iommu_init.c +++ b/xen/drivers/passthrough/amd/iommu_init.c @@ -625,6 +625,18 @@ static void parse_event_log_entry(struct
2006 Mar 02
5
Two foreign keys on the same column?
Let''s say I have three hypothetical MySQL tables: ? people, with columns id, gender, and source_id belongs_to :boys and :girls ? boys, with columns id and name has_many :people ? girls, with columns id and name has_many :people The gender column in people specifies which of the two source tables the source_id refers to. For example, if we have values: 1, boy, 1 in people,
2013 Jun 22
4
ActiveRecord::Base.transaction - SystemStackError - stack level too deep:
Im having an issue that seems to only happen when trying to use a transaction. Ive used transactions many times in the past and Im at a loss as to why im getting the stack level too deep problem. SystemStackError - stack level too deep: actionpack (3.2.13) lib/action_dispatch/middleware/reloader.rb:70:in `'' I have a StackOveflow with more detail -
2008 Sep 26
1
Problem with authentication... Acts As Authenticated
Hello, I am working on the API of our webservice. API users need to authenticate some of their calls... When I am performig the call through Firefox, everything is fine as shown in the log : Processing OwnershipsController#new (for 67.207.118.174 at 2008-09-26 16:20:03) [GET] Session ID: BAh7BiIKKmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo
2006 Dec 21
1
need some guidance with a test
This is part of a rails project. The following method is part of the Ams class (a rails model). I''m a bit unsure of the rspec/bdd way of testing this method. def persist_as_domains @current_domains.each do |d| dom = Domain.new dom.domain = d dom.source_id = 1 dom.at = Time.now dom.save end end The following is what came out when I tried to write my test. Notice
2006 Jul 17
7
Ajax Tabbed Browsing
I was wondering if anyone has done this, namely make tabbed browsing exactly like a web browser, but have it within the page. I would like to make a search function that updates a section of the page with the results, as well as makes a new tab that displays those search results. Then, if a user did 5 searches, there would be 5 tabs. Each tab would hide the other 4 results and show the
2006 Jul 26
4
can you pass data when you render :action
how can i do: render :action => "headline", :id => @user.id Thanks, Ben Lisbakken -- Posted via http://www.ruby-forum.com/.
2006 Jun 21
3
Call action & display nothing?
Can you do a periodically_call_remote to an action but then not display any new view? say the new action was called ADD. I don''t want to do an rhtml file for add, and I don''t want to render anything in the controller... I want to leave the page as it is. How is this done? Thanks, Ben Lisbakken -- Posted via http://www.ruby-forum.com/.
2008 May 27
2
HABTM using two columns
Hi all, I was wondering whether anyone could guide me to docu and code examples how to create and use a has_and_belongs_to_many relationship with a joining table where TWO columns are used to identify the relation to TWO alternative tables. Example: table 1: mothers [mother_id, name] table 2: fathers [father_id, name] table 3: children [child_id, name] joining table 4: children_parent
2006 Jun 30
5
Off Topic - Image size convertor?
I''ve been googling around, and have found a lot of tools to convert images to the right pixel size - anyone have a good command line based one for linux? Also, how do you issue a command from a rails app? Thanks, Ben Lisbakken -- Posted via http://www.ruby-forum.com/.
2006 Jul 19
2
Mouse Location
Is the only way to get the mouse location by using javascript? Or does rails do it for me?!? :) Does anyone have a simple script that they use? I''m trying to put a div right where the mouse is clicked on a link... so I''m looking for it to work like this: a hre f=. onclick=Element.setStyle(''title_login'', {left: MOUSEX,top: MOUSEY;});new
2006 Jul 25
11
Prevent users from entering urls
How could I make it so that links on my page could link to a controllers action, but if the user manually entered the url, it would redirect them back to the main page? Is this possible? Thank you, -Ben Lisbakken -- Posted via http://www.ruby-forum.com/.
2006 Jul 18
3
Navigation techniques, everyone?
I''m rewriting the code to my first app. I want to reuse a lot of it, but tidy it up a lot. The first thing I will tackle is my nav-bar. Throughout a user''s experience on my app, I want it to reload as little as possible (I''ll have about 7 or 8 controllers with about 70 actions). So, I''ve thought of a few ways of doing it, and was wondering if you guys
2006 Jul 20
7
How do you use :message with validation?
If I do validates_uniqueness_of :name, :message => "It''s not uniqueeee!!!" then how do I have it display that message when the check fails? -Ben Lisbakken -- Posted via http://www.ruby-forum.com/.
2009 Aug 11
1
[PATCH server] remove appliance bits
This removes the appliance configuration bits from the installer and associated files since it has been deprecated --- installer/modules/ovirt/files/cobbler-import | 6 - .../modules/ovirt/files/ovirt-appliance-setup | 4 - installer/modules/ovirt/files/ovirt-storage | 73 ---------- installer/modules/ovirt/manifests/appliance.pp | 152 -------------------- 4 files
2006 Jul 19
4
Using Application.rhtml as layout for all controllers
I put my nav system in application layout. that way any controller loading will have the nav system. I have one problem though - the <%= yield %> is in the body, so how would my controllers specify other css files? my application layout would look like this: <html> <head> title css include javascript include </head> <body> nav system <%=yield%>
2006 Jul 31
2
How do you grab the source HTML from a url?
I want to grab all of the list of users from my app and make a nice formatted list of them every week, and I was wondering what rails command would grab the source html from a url? Thanks, Ben Lisbakken -- Posted via http://www.ruby-forum.com/.
2006 Jul 16
3
RJS problem
I have an odd problem while trying to use a simple rjs. _test.rjs : page.alert "test" test.rhtml: <script><%=render_partial(''test'')%></script> When I am attempting to view controller/test the page comes as if it was a text file. So i am actually seeing: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"