similar to: Manipulating has_many :through associations

Displaying 20 results from an estimated 1000 matches similar to: "Manipulating has_many :through associations"

2006 Apr 18
2
link_to_function onmousedown
Hi, Is there some way to produce an anchor that looks like the following using helpers, or should I just code it in the rhtml like this? <a href="#" onmousedown="javascript:foo(); return false"> Thanks, Brad -- Bradley Mazurek
2006 Jun 09
8
Installation on OSX...
Hi, Just got my first Mac. I''m trying to install rails on it, using the instructions in the rails wiki: http://wiki.rubyonrails.com/rails/pages/HowtoInstallOnOSXTigerUsingDarwinPorts I go to install mysql, and the version of mysql supported by DarwinPorts appears to be 4.1.18. But all the sites appear to only have 4.1.19 or 4.1.20. So it looks like DarwinPorts is over a month out
2006 May 24
1
How to marshal Javascript data?
I''m trying to marshal some information I have in Javascript, and send it over an AJAX request to the server, specifically to be stored in a model on the server side. I have some Javascript routines I wrote that gather information about the user selection. I see that the link_to_remote has a :before option in which I can write Javascript to collect what I need, but right now I''m
2006 Apr 11
4
Managing "application scope" data - best practices
All, I have some data that I need to be able to see across the application. For J2EE people out there, I need something that I want to have available in the "application scope" of my app. What is the best way to handle this? I''m trying to access a class variable that I created in my controller from my view (to no avail). Create a class variable in my helper class and use
2006 Aug 01
1
Legacy Pluralized Table Names
I am connecting to a legacy DB that has some names plural and some not. I have configured: ActiveRecord::Base.pluralize_table_names = false now when i make a table that has an s on the end, it truncates the s. example: Table name: foo_bars Rails command: ruby script/generate FooBars Response (localhost:3000/FooBars): uninitialized constant FooBar It works fine with non-pluralized
2006 Mar 08
1
Components calling components...
Hi, I''m relatively new to ruby and rails. I would like to have a sidebar component call one of several other constituent components. I''ve run into some problems, and so I''ve pruned things back to a relatively simple case. I have a sidebar component. Renders great. In it''s layout, I call render_component for another component I would like in the sidebar.
2006 Mar 17
2
How to let the layout be more OO?
I am confused about the @content_for_layout.''cause it will display all the views in the layout.Do I have any methods to let the layout be more OO? I mean that for example,the app currently have more than one views to be displayed,but only some of them to be displayed at the same time at different <div></div> units. I hope there exists a kind of way that: <%= if
2004 Aug 16
2
randomize Dial() target
Hi, is it possible to randomize extension which would be choosed by Dial()? I would like to forward phone calls to one of sales rep in randomized way (not to harm anyone;) ). tia mazek -- http://www.marcinmazurek.com/ ::: nic-hdl: MM3380-RIPE GnuPG 6687 E661 98B0 AEE6 DA8B 7F48 AEE4 776F 5688 DC89
2011 Jun 22
0
has_many relationship in Gem
Hello, I am creating a gem in which I need to add a new has_many relationships: ... included do |base| base.has_many :foos end def some_method self.foos # end ... Here Foo is a model I created and it is places in app/models/Foo.rb I wonder if I can use syntax like the line marked with #? If yes, I got NoMethodError for using "self.foos" when writing rspec
2007 Aug 06
0
Problem generating scaffold with a namespace
I''m trying to generate a scaffold based on a model in a namespace and I would like the controller to have a similar namespace. Am I thinking that scaffold should be doing something it doesn''t or is this a bug? rails version: 1.2.3 ruby version: 1.8.5 OS: OS X 10.4.10 Created a model using > script/generate model Foo::Bar creates the model bar.rb in the model/foo directory
2004 Apr 18
4
Intel 536ep as a FXO?
Hi, I've seen some reports about ruuning Intel modem with 537 or MD3200 chipset running with Zaptel drivers as a FXO port. Did anybody managed to set up a PCI faxmodem based on Intel536ep chipset to work with * and Zaptel drivers? Modem seemd to work just fine with Linux, but the driver says no;) some more info: Linux 2.4.26 mazuchna:~# cat /proc/pci | grep 536 Communication
2007 Jun 22
0
Using through with habtm
I have two models with an habtm relationship: Foo has_and_belongs_to_many Bars (and vice-versa, obviously). Let''s say Bar has_many Bazs (how the heck do you pluralize Baz?). It would be nice to be able to say that Foo has_many Bazs through => Bar, but this does not seem to work. Am I right, or should it be possible to do this? The best I have been able to do is this: bazs =
2012 Nov 27
0
[LLVMdev] libclang issue: CXCursor_FunctionTemplate does it work?
Hi, I'm a happy user of libclang.so I got in trouble trying to get info from templated function such as /* File: t.cc */ template <class T1,class T2> void my_foo(T1 a,T2 b) { } I only got CXCursor_FunctionDecl cursor instead of CXCursor_FunctionTemplate and I don't getting CXCursor_TemplateTypeParameter. And argument type is Unexposed. I using 3.1 version with few patches.
2006 May 05
0
Missing documentation for find_in_collection? Trying to drill down in a 4 level has_many association fails
I''ve been reading up in ActiveRecord::Associations and playing around with my app via the console and found some interesting methods via the code completion of IRB, but I have no idea how to use them and can only find one hint in the API http://api.rubyonrails.com/classes/ActiveRecord/Associations/ ClassMethods.html It mentions here in the has many associations that if you use the
2010 Apr 27
2
Resolving functions using R's namespace mechanism can double runtime
It appears that the runtime for an R script can more than double if a few references to a function foo() are replaced by more explict references of the form pkgname::foo(). The more explicit references are of course required when two loaded packages define the same function. I can understand why use of this mechanism is not free in an interpreted environment like R, but the cost seems rather
2008 Jun 07
5
Can create record but can not update it => has_many through
Hi All, I have a problem using has_many through association. I can create a product without problem, but when i edit it, i got this NoMethodError: undefined method `reciters='' for #<Product:0xb71a77e8> Did i miss something to code? I provided the codes below. Please help Thanks, Dida product_controller.rb ====================== def create @product =
2008 Jun 13
2
Rails 2.1.0 - find with :include and missing JOIN in SQL query
Hi, We''re trying to rewrite veeeery old Rails app that we successfully managed to move to 1.2.6 and now we''re trying with 2.1.0. One of the problems is caused by :include in AR.find. Rails 1.2.6 generates totally different SQL query than 2.1.0. Here''s Rails find query and generated SQL queries: Foo.find(:all, :include => :ticket, :conditions =>
2007 Jul 29
1
Curious why this doesn't work. (has_many, belongs_to)
Two Models. class Gm < ActiveRecord::Base belongs_to :pool # mode code here. end class Pool < ActiveRecord::Base has_many :gms # mode code here. end Testing code through the console. >> gm_list.each{ | gm | puts " GM name: #{ gm.user_name } belongs to Pool: #{ gm.pool.pool_name } " }; nil GM name: John belongs to Pool: RHP 07-08 Season - Career League GM name:
2006 May 25
0
Double Render Error...
I''ve been fighting with a Double Render Error. I have some sidebar partials that I render to strings in my application controller''s before_filter: @left_sidebar_for_layout = render_to_string(:partial => ''shared/left_sidebar'') Then in my application layout, I simply add them as a string, like I would @content_for_layout This normally works fine. However,
2006 Mar 08
0
Can components call components?
Is a component supposed to be able to call another component (which presumably could call another component)? Brad -- Bradley Mazurek