search for: diekmann

Displaying 20 results from an estimated 42 matches for "diekmann".

2006 Apr 13
10
Typo and acts_as_ferret rebuild_index errror
Hi, I''m running the edge Typo and the latest acts_as_ferret plugin and ferret gems (as of 11 April). In my Content model I put acts_as_ferret :fields => [:title, :body] In the console, I call Content.rebuild_index to index all of my existing content. All the directories get created etc, but I get the following error back: Loading development environment. >>
2006 May 31
7
How to render from with <%%> ?
I have a loop that I iterate through in my view. <% coll.each do |itm| puts(itm.value) end %> How do I render the itm.value without using a <%= %> tag? Should puts not work? Joerg P.S. There is a good enough reason for me wanting to do this :-) -- Posted via http://www.ruby-forum.com/.
2006 Mar 13
8
Nested find(:all, :include => ) statements
Is there a way for me to do: OrderItem.find(:all, :include => [:user, :product => [:supplier]] So I don''t have a supplier_id on my order_item, but have it on my product, which is part of order_item. Joerg -- Posted via http://www.ruby-forum.com/.
2007 Jun 13
14
Do delegates work properly in Drb mode?
Hi folks, I have several models that index well in Drb mode. However, I have one scenario where it works in normal mode, but not in Drb mode. model A field :one end model B belongs_to :a field :two delegate :one, :to => :a acts_as_ferret :fields => { :one => {}, :two => {} }, :remote => true end If I leave off the :remote parameter, it works. Or, if I don''t
2006 Jan 30
2
Rake and NOT using schema.rb for clone_structure_to_test
Is there a way to specify not not use schema.rb but instead using a native sql file to clone structure to the test db? Schema.rb doesn''t really work that well for mediumblobs ... Thanks. -- Posted via http://www.ruby-forum.com/.
2006 Jul 17
14
REST Relationship Models
I''m trying to figure out an elegant way to do this: I have the following three tables: people, employer, employees And consequently the following three models: class Person < ActiveRecord::Base end class Employer < ActiveRecord::Base has_many :employees end class Employee < ActiveRecord::Base belongs_to :person belongs_to :employer end I want to be able to say:
2006 Jan 12
8
Synching between Sqlite and MySql
Hi folks, I am running an offline Rails app that periodically connects to the Internet to download the latest catalogue, and upload any new orders. I am about to implement the synching bit - and was thinking whether there is any other solution other than writing webservices and code to do a manual sync of the data, or whether there is a more nifty and robust way using say replication?
2006 Mar 14
5
GROUP BY and SUM
I have orders, order_items, and products. I want to collate several orders so that I can get a SUM of quantities ordered for each product etc. Can I say something like (the below gives an error on :sum, and ignores :group) OrderItem.find(:all, :sum => ''quantity'', :group => ''product_id'', :include => [:order, :product]) I want to get back a
2006 Jul 31
3
Simply_RESTful and Bulk Import URLs
Hi, I have a people controller, and want to import bulk import multiple people from a CSV file. In my routes.rb file I have: map.resource :person Now, it''s a little unclear to me how to further configure the routes to allow me to add the following URLs: I need a URL to choose a file to upload, so I need an HTML ''frontend'' for it, so I figured the following URL
2006 Apr 20
2
index_dir path
Hi, I am running several applications, and I need them to share their indexed data. So instead of putting my index in the default location of RAILS_ROOT/index/RAILS_ENV I want it to appear in RAILS_ROOT/../index/RAILS_ENV (ie in the parent directory of each of my root directories ... I have three apps working together) In the acts_as_ferret file, I have changed line 73 to: index_base =
2006 Feb 14
7
Launching a standalone Rails app
Hi, I''ve developed a standalone Rails app - using tar2rubyscript and rubyscript2exe. The users aren''t going to understand that the''ll need to open the browser and go to 127.0.0.1:3000 to view the app, after running the exe. I am wondering whether other people have tackled this problem in the past, and how they went about solving it. One way would be to write a
2006 Jan 22
3
Download an Image using Net::HTTP
Hi, I need to download an image, and I''ve mucked about with Net::HTTP resp = Net::HTTP.get_response(''www.mydomain.com'', ''/test.jpg'') f = File.new("test.jpg","w") f.write(response.body) And various other combinations using HTTP.get etc. Anyway, I get an image, but it looks very psychedelic. This is obviously not the correct way.
2006 Jan 30
3
Arrays of objects as parameters to webservices
I think I am missing something terribly obvious. Is it possible to have an :expects parameter for a webservice that is an array of objects? I want to have a single webservice that expects all my line items (for an order). Is this something that is possible? -- Posted via http://www.ruby-forum.com/.
2006 Jan 15
6
Saving one-many associations (elegant solution please)
What is the most elegant way to save new one-many associations? order = Order.new(:name => "My Order") order.line_items << LineItem.new(:product_id => 1, :quantity => 2) order.line_items << LineItem.new(:product_id => 2, :quantity => 5) order.save The above - which is by far the most elegant way of putting it - doesn''t work for me - the line_items
2006 Feb 22
4
UUIDTool and weird timestamp split error
Hi, I am using UUIDTools to generate my Guids. It works fine on my computer (Windows Xp), but doesn''t work on my host (TextDrive) The error is: Loading production environment. >> UUID.timestamp_create.to_s /sbin/ifconfig: Permission denied NoMethodError: private method `split'' called for nil:NilClass from ./script/../config/../config/../lib/uuidtools.rb:236:in
2006 Jan 06
6
AWS and array of Model
Hi! I try to use a layered webservice and I want to get back an array of users; In the API I use: api_method :listUsers,:returns=>[[User]] in the service: def listUsers User.find(:all) end Result in soap mode: Don''t know how to cast TrueClass to Object Result in XML-RPC mode: You have a nil object when you didn''t expect it! You might have expected
2006 Jan 11
5
stack level too deep problem
Hi all, I''m trying to overload the link_to function, (to disable link_to if the user has no access right) this is my code, it work the first time I run the application, the second time I refresh the page I always get "stack level too deep error" module UsersHelper include ActionView::Helpers::UrlHelper alias_method :link_to_original, :link_to def permission? true
2006 Aug 10
1
Passing parameters defined in a function or something
Hi, I have method I want to call ... it can receive * number of parameters. I also have 3 parms that I want to pass often, so I have defined them in a separate function: def my_params { :parm1 => 1, :parm2 => 2, :parm3 => 3 } end And I want to call my method like this: mymethod :parm4 => 4, my_params Now - this doesn''t work - as my_params is a hash of params, which
2006 Jul 19
2
SimplyRestful bug?
Hi I have my routes set up like this: map.resource :contact, :path_prefix => "/employers/:employer_id" so now when I view all contacts for an employer I go to: /employers/1/contacts That works. On that page, there''s a problem with the routes: new_contact_url translates to: /employers/1/contacts/new ... so that works. But, contact_url(@contact) gives me
2007 Jun 12
2
Starting script/ferret_start problems
Hi - I have a fresh install of OSX, Rails, Ruby, Ferret, AAF etc ... Everything is working fine, I can start mongrel, I can start backgroundrb, but Ferret Drb ... doesn''t want to work. RAILS_ENV=development script/ferret_start Gives me: env: script/runner: Permission denied Is there a way I can debug this to figure out what is going on - or is there another way to start Ferret Drb?