About DateBocks
Nathaniel,
DateBocks works really well. I did find one deficiency however - I typed “year of the pig” and instead of populating the correct year it says something silly like ‘invalid date string’
jokes aside, it’s a great control. Any plans for a TimeBocks?
Cheers
Hammed
Hey Hammed,
Didn't consider that match before
TimeBocks is on it's way, along with a combined DateTimeBocks.
-NSHB
Hi, i think it’s pretty cool, but one thing that I’d like to do that it doesn’t: “3 days ago” “2 weeks time” etc.
Nathaniel Brown wrote:
Hey Jeremy,
Just added two new feature request tickets based on your recommendations.
http://dev.toolbocks.com/tickets/14 http://dev.toolbocks.com/tickets/15
Thanks for the feedback.
-NSHB
Thanks for a great engine, Nathaniel! But I had 2 issues when trying to use it, one major and one minor issue...
Minor issue: the documentation says...
Add "Engine.start :datebocks" to the end of ./config/environment.rb
... but should read "Engines.start :datebocks" (ie. small type, should be "Engines" instead of "Engine")
Major issue: the documentation also says...
Restart your webserver of choice
That worked fine for WebRICK, but when I tried to deploy my application in Apache/CGI, I get the following error message, eventhough I added the required "includes" it both ApplicationController and the ApplicationHelper:
undefined method `datebocks_field' for #<#<Class:0xb7848f6c>:0xb7848f44>
Any ideas what might be going on? Weird that it works when I run my app from WebRICK, but throws an exception when I run it from Apache?!?
Thanks very much in advance,
Peter V.
Nathaniel Brown wrote:
Hi Nathaniel:
I've added tickets 16-18. I especially like 16 "once in a blue moon"
Just adding common date expressions.
Thanks for the plugin, -- Tom.
Hey Peter,
Added the bug for the "Engines.start :datebocks"
http://dev.toolbocks.com/tickets/19
For the helper, my guess is you haven't added the required line to your application_helper.rb file..
module ApplicationHelper include DatebocksEngine end
There is a demo application I made which has DateBocks running which I use on http://datebocks.inimit.com at
http://svn.toolbocks.com/demos/datebocks_engine/
With Apache, you likely have to restart the FCGI process you have running. For some reason you may need a stop/start.
-NSHB
Thanks for adding the tickets.
I especially like the wikipedia common date expressions for #18.
-NSHB
I especially like the wikipedia common date expressions for #18.
Hehe, the first thing I tried was "4 score and 7 years ago" The next thing I tried was "in a fortnight". Looks like the Wikipedia entry covers them all (and more--I've never heard of a lustrum).
But one that may actually be useful that also didn't work: "a week from Friday"
- Mark.
there’s a typo in your install instructions, it should be “Engines.start :datebocks”, you’re missing a frustrating s!
Nathaniel Brown wrote:
Hey Jeremy,
Thanks for the heads-up.
Someone pointed that out, and I submitted a bug report.
http://dev.toolbocks.com/tickets/19
-NSHB
Nathaniel,
I’m deploying my app with Capistrano. Datebocks works beautifully on my local machine, but when I send it to the server it looks as if the engine_files (css/js) aren’t even being copied over into the public directory.
Have you run into this before? Any ideas what’s going on?
Hi !
I'm deploying my app with Capistrano. Datebocks works beautifully on my local machine, but when I send it to the server it looks as if the engine_files (css/js) aren't even being copied over into the public directory.
Can you request the files from your browser ? http://app.com/engine_files/datebocks_engine/stylesheets/engine.css
Or whatever ? What about permissions ? You can confirm that you have Engines.start in environment.rb ?
Have you run into this before? Any ideas what's going on?
Nope. Works beautifully here.
Bye !
Francois,
I’ve done lots of work with engines (see Substruct
So, I already tried that. Looks as if engine_files isn’t even being created in my site/current/public directory upon a deploy - which is really strange. I guess I should hit up the engines mailing list to see what’s up.
Hey Seth,
As Francois mentioned, it is really a case of two things.
First would be that the Engines.start :datebocks isn't being called.
If you have substruct, simply add a comma and put another symbol after :datebocks.
Seeing as it is working locally, this doesn't sound like it would be it though.
Second would be the permissions on the engines_files directory. That needs to be +rw by the same person who starts the web server. If that is the case, and you can verify that the css/js files are indeed being copied over, then it's to do with the web server user not being able to access the files.
-NSHB
Nathaniel,
is there any config parameter to change the default date format from YYYY - MM -DD to MM/DD/YYYY?
Rafael
subimage interactive wrote:
I'm deploying my app with Capistrano. Datebocks works beautifully on my local machine, but when I send it to the server it looks as if the engine_files (css/js) aren't even being copied over into the public directory.
Have you run into this before? Any ideas what's going on?
I have a similar issue... Datebocks works beautifully when running the application via Webrick, but when I deploy it in an Apache/CGI environment, it gives me the following error message:
undefined method `datebocks_field' for #<#<Class:0xb7848f6c>:0xb7848f44>
(FYI: I posted this issue on this thread about a week ago) ... I'm not sure this is the same issue as yours, but it definitely appears that the two problems might be related. Hopefully the following might be of use to you:
I haven't been able to resolve this issue yet, but I have been able to verify that it is most likely not a permissions issue: by logging "Engines.start.inspect" I can actually verify that both "vendor/plugins/engines" and "vendor/plugins/datebocks_engine" are loaded (and from the correct location) in the webrick as well as in the apache/CGI setup.
However, in the Apache/CGI setup, it appears that the Datebocks engine stuff isn't correctly "included" in the ApplicationHelper module (and hence not correctly mixed into the templates) which at least explains the above error message...
Using "ApplicationHelper.method_defined? :datebocks_field" before and after starting the engines, I seem to be able to confirm that somehow the Datebocks stuff doesn't get included: in my WebRICK environment, I get "false"/"true", but in my Apache/CGI environment I get "false"/"false".............. things that make you go hmmmmmmmmmm
But why it doesn't get included is still a mystery... the investigation continues. Anyway, maybe the above is useful info for you to get to the bottom of your problem. FYI,
PV
Nathaniel, I wrote Substruct
Yeah - stupid me it’s a permissions problem. Good looking out.
Hey PV,
I am curious whether or not DateBocks itself is being loaded on Apache/CGI?
Can you verify in your log/production or development logs that it is indeed being started correctly?
Next question I would ask is whether or not the code on the Apache server is the same. If you have the Engines.start :datebocks code within your environment.rb, and both the engines plugin and datebocks_engine plugin are sitting comfortably in the vendor/plugins directory, it would lead me to assume that Apache has not yet been restarted. Or may need to have a hard stop/start to kick DateBocks into the loaded CGI cycle.
-NSHB