Displaying 20 results from an estimated 33 matches for "joergd".
Did you mean:
joerg
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 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/.
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 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
2006 Jan 10
2
Returning :success or :failure to remote function calls
Hi,
When calling remote functions (AJAX), I can test for :success and
:failure. But how do I return a :success or :failure to my AJAX function
call from my action?
Thanks
Joerg
--
Posted via http://www.ruby-forum.com/.
2006 Jan 20
2
AWS and passing in a Model
Hi,
I have a webservice. And I want to pass in, a model.
So, for example:
api_method :save_person, :expects => [Person]
When I do this I get an error saying that I cannot have ActiveRecord
objects as parameters. Fine. I can have AWS Structs as parameters. I
don''t want to start ''maintaining'' a struct everytime I change the table
structure od Persons.
So, is
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 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 Jun 21
48
Freelance Rate
Hi,
Not sure where to address this question ... but I guess this is a good
start. I am a freelance Rails developer - and have been developing Rails
apps professionally for about a year now. I just want to get an idea of
what you other freelancers charge yourselves out at. I have been
charging the equivalent of about $28/hour, but get a sense that I
could/should charge a whole lot more. I am
2006 Jun 08
0
custom mime types for respond_to
Is there a way to add a mime type of my own to respond_to ?
There''s html, xml, js, ical etc ...
But I want to be able to respond_to Excel.
Excel has the following content-type header:
application/vnd.ms-excel
I want to use the new ?format=xml querystring parameters that respond_to
can respond to.
So I want to pass in ?format=xsl or ?format=ms-excel so that I can
return my results
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?
2007 May 31
0
script/runner permission denied
Hi,
I have been running ferret for several months now, but want to make use
of the new Drb functionality. So I am running Rails Stable (off the
branch), Ferret 0.11.4, and the latest AAF. I have a ferret_server_yml
file in my RAILS_ROOT/config folder:
production:
host: localhost
port: 9009
pid_file: log/ferret.pid
And I took the three scripts from the AAF plugin and put them into my
2006 Mar 13
0
Using :group in find method
I''m using Edge Rails: Has anybody used :group (and say :sum) in a find
method? It seems to ignore it, and my generated sql contains no mention
of GROUP BY.
Or am I not getting it?
--
Posted via http://www.ruby-forum.com/.
2006 Feb 20
0
YAML and has many associations
Hi,
I have the following:
order = YAML::load(order_yaml)
The YAML contains order_items too, and my order model has a has_many to
order_items.
When I do order.order_items, I don''t want Rails to go the db to get the
order_items, but use the order_items already contained in the object
created from the YAML.
How would I do this?
Thanks
Joerg
--
Posted via
2006 Feb 27
0
AJAX Timeouts
Some long-running AJAX calls are returning Execution Timeout errors -
though after a few seconds already which I find very strange, as on
other computers I can run these AJAX scripts for 10 minutes without
timeouts.
Is there a setting somewhere, that I can set to adjust my timeout value?
Or am I barking up the wrong tree?
Thanks
Joerg
--
Posted via http://www.ruby-forum.com/.
2006 Feb 27
1
Trapping specific errors
Hi,
I have a begin rescue clause and want to trap for specific errors
begin
cause error
rescue Excpetion => err
case err
when SocketError
do stuff
when ... # trap for ErrNo::EINVAL
end
end
Say I get the error ErrNo::EINVAL ... how/where can I find out what the
Excpetion for it is named?
I have tries ErrNo::EINVAL, ErrNo::EINVALError, EINVALError, but none of
these seem
2006 Jan 08
2
How do can I use XmlRpc with my AWS?
In my tests, I want to invoke my webservice not using the default SOAP
protocol, but using XmlRpc ... how do I do that?
--
Posted via http://www.ruby-forum.com/.
2006 Jan 15
1
Cloning a one-many association
Hi, I want to make a copy of an object with its associations, and I am
looking for an elegant solution. This is what I intuitively think should
work, but it doesn''t:
order2 = order1.clone
order1.line_items.each do |o|
order2.line_items.build(o)
end
This doesn''t work because a model class does not stringify its keys ...
so I can''t pass an object into a method that