[Rails] Re: Should I continue with rails?

2010-01-08 Thread candlerb
On Jan 8, 6:52 pm, Dan Smith wrote: > Can anyone suggest anything to try? Does your host give you shell access? If so, cd to your project directory and run script/console and RAILS_ENV=production script/console and see if you get any error message back in either case. If it's successful,

[Rails] Callbacks from model to request?

2010-01-08 Thread candlerb
I'd like to ask if people have thoughts on clean ways of making behaviour in the model depend on attributes of the request. Things I'm thinking of: * per-user Time.zone (currently handled by setting a thread-local variable in the controller) * created_by and updated_by fields. Googling around, t

[Rails] Re: How can a rails app get its host name?

2009-11-20 Thread candlerb
To find what the machine thinks its own name is (which may or may not be related to the hostname you want in a callback url), try: Socket.gethostname As has been pointed out, the callback url also needs things like the port. If you are generating this within a controller action, you could of co

[Rails] Re: Terminating a request early with throw or raise

2009-11-20 Thread candlerb
> If you do want those semantics (perhaps because you're inside one or > more helper methods where it's not so convenient to just render and > return) then it should be easy enough to recreate them with an around > filter. An around_filter with catch and yield would do the job. I hadn't thought of

[Rails] Re: Terminating a request early with throw or raise

2009-11-19 Thread candlerb
> Why do you need to terminate a request early?  Is this an HTTP request? By "request" I meant "controller action". Within a method called by the controller action, I want to render something and then prevent the controller action from continuing any further (otherwise I'd get a double-render err

[Rails] Terminating a request early with throw or raise

2009-11-19 Thread candlerb
Is there a standard way in Rails of terminating a request early with throw or raise? I am thinking of when a controller invokes a private method and inside that method I wish to render a result and then finish. For example: def my_action ... authorize_something ... end private

[Rails] Re: snailgun: speeding up process startup

2009-05-15 Thread candlerb
> An alternative approach would be to start separate processes for > 'test' and 'development' environments, so they can both run the > initializer to completion. This would give the maximum speedup, and as > long as you set config.cache_classes = false in the test environment, I decided to go wit

[Rails] [ANN] snailgun: speeding up process startup

2009-05-15 Thread candlerb
://github.com/candlerb/snailgun/tree/master I can demonstrate script/runner starting in about one-quarter of the normal time, for an empty rails app. However the code is far from usable at the moment - in particular, I don't know why it doesn't work properly with `rake test` where t