Displaying 20 results from an estimated 8000 matches similar to: "Timezone problem"
2006 Apr 11
11
I can''t get rails to see my plugin. How can I this?
I''m trying to produce a plugin to help me with my page caching woes. I
can''t seem to get rails to see my method within the plugin. This is my
first attempt at a plugin so I''m sure I''m missing something. I''ve
created a directory /vendor/lib/plugins/broom_stick/. I then created an
init.rb file with:
require ''broom_stick''
I then
2006 Jun 01
3
rake create_sessions_table, does not create session table
when i run rake create_sessions_table, I get following output. tables
donot get created and my application doesnot start.
(in G:/rubysrc/blog)
create db/migrate
create db/migrate/001_add_sessions.rb
info: the first time ran take everyting was fine, but now i have
reinstalled ruby and rails and created the database, but i am unable to
create session table with rake, please help.
2006 Mar 01
5
validations without AR - going crazy trying to find link
Hi,
in the past few months someone posted an entry on their blog about
how to do validations in non-AR classes and I cant find it any more.
Anyone have a link?
Thanks,
Trevor
--
Trevor Squires
http://somethinglearned.com
2006 Feb 17
4
Table with Constants
I would like to have a table with some constants to use them later on
for a drop down menu. How can this be done?
My table looks like
Table with constants
------------------------
id | key | value | type
------------------------
1 | M | Male | sex
....
I know it can be done like this
<% select ''object'', ''method'', Constants.find(:all, :select =>
2007 Sep 21
3
TextMate Bundle and exception when switching to alternate file.
Hey,
sorry if this is something better suited to another list.
I''ve encountered a strange problem with the RSpec.tmbundle in trunk -
namely that it was raising an exception when pressing
ctrl-shift-downarrow (switch between spec and source - "Alternate
File").
I tracked down the issue to be handling of the file_type in
switch_command.rb#content_for() - the code expected the
2006 Apr 19
8
Module and Model
I am getting the following error
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:1129:in
`method_missing'': undefined method `directory?'' for Msg::File:Class
(NoMethodError)
I have a model called Msg::File in models/msg/file.rb, and I have a file
in lib/msg/helper.rb which references to both Msg::File and
File.directory?
How do I help activerecord
2006 Apr 17
2
Understanding when flash gets reset (render vs. redirect_to)
All,
I have a controller action that will do a different "render (:action)"
call
depending on whether or not data is valid.
When the data is invalid - I set a flash element to hold a message.
However, when I post back to this controller action and have valid data,
I still have the flash element set, which I don''t want.
I believe this is because I did a render from the
2006 Mar 22
5
Class Caching Problem [was Newbie Question about Custom Classes]
So any other ideas as to why my custom class under app/models is being
cached even though all the caching is set to false in the
config/environments/* files? Currently I''m having to restart WEBrick
after EVERY change to the file. The controllers and views are
reloading just fine and not being cached. It''s just the custom class
I created that''s being cached.
Any ideas
2006 Apr 17
3
Does render() have 2 be last statement in controller method?
I have a controller method that is attempting to do a render based on a
potential error condition.
So I have
if (condition)
render()
else
..other code
end
....other code in method
Should I expect the render to take place immediately or does the render
call not work because it isn''t the last statement in the method?
Thanks,
Wes
--
Posted via http://www.ruby-forum.com/.
2006 Mar 31
5
Model reloading problem
Hi all,
I''ve a model class Toto in the model directory.
I don''t understand why i have to restarts WebBrick to view changes i make
in this class
FYI : in the development. rb i desabled class cache with
config.cache_classes = false
Regards
Luciano
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2005 Dec 08
2
bounce effect
Hi,
I was wondering if anyone has seen (or completed) an effect to make
something ''bounce'' like icons do in the OS X dock when you launch
them? Something that looks like there''s a bit of gravitational
behavior to it?
Thanks,
Trevor
Trevor Squires
http://somethinglearned.com
2009 Apr 01
1
Vector of Vectors
I have a matrix of data. I need to scan the matrix and find every
sequence from maxima to maxima across a row. I can write a loop to do
this easily. Problem is, I can't figure out how to store the results.
Each result is a vector of widely varying lengths. Ideally I'd like a
vector of these, i.e. a vector of vectors, so I can quickly iterate
through them and compute correlation
2005 Oct 19
1
TZInfo::Timezone problem selected value
hey, i have a record in the database gtm_zone with value ''Europe/London''
i want to have a select box with all the zones and the corrected selected
@firm.gmt_zone = Europe/London
TimeZone from ruby (trying to expand with TZinfo)
dont want to select Europe/London, and not sorted
<select id="firm_gmt_zone" name="firm[gmt_zone]">
<%=
2007 Apr 19
1
Time zone mapping from TimeZone to TZInfo::Timezone
Hi. Using this:
<%= time_zone_select("account", "time_zone" %>
I get a list of time zones options, like eg.:
<option value="Athens">(GMT+02:00) Athens</option>
But as I''m using TZInfo::Timezone, I need to map ''Athens'' to
''Europe/Athens''
I can see that the mapping I''m looking for is
2006 May 31
13
What are controller modules *for*?
I am aware that controllers can be placed in modules:
ruby script/generate controller modulename/controllername
But what does this buy me? Is it just a way of ensuring that my source
code is nicely arranged, or can I use the fact that a set of controllers
are all within a particular model to implement functionality common to
all of those controllers?
Why am I asking?
The app
2006 Feb 15
2
extending rails via /lib - problems
I wanted to group some functions which I use in some models in one
place. Controllers have application.rb and views have helpers but I
couldn''t find anything about models. Using the /lib directory seemed to
be the only way.
Alright... so I have something like this:
/lib/code.rb
class ActiveRecord::Base
def method_a(n)
.......
end
def method_b(n)
........
end
end
2006 Apr 20
5
strange mysql problem
i have this model:
class LineItem < ActiveRecord::Base
belongs_to :quote
end
in the console:
>>l = LineItem.create
ActiveRecord::StatementInvalid: Mysql::Error: You have an error in
your SQL syntax; check the manual that corresponds to your MySQL
server version for the right syntax to use near '' , , , )'' at line 1:
INSERT INTO line_items (`qty`, `quote_id`,
2005 Nov 18
6
wrong number of arguments (2 for 1) error message help
All,
This is really starting to get me as i can''t figure out why I am
getting this error. Here is what is going on. I have a table called
items and a item controller. When I add a new item to the items table
I am also creating several associated tables. the code for this so
that you can follow along is:
def create
@item = Item.new(params[:item])
# The item belongs to
2006 Jun 07
4
Setting default timezone ENV[''TZ'']=''UTC'' not working on windows?
Hi,
I''ve been trying to do timezone conversion, and have some trouble
getting it to work on my Windows machine. Searching the web, I found
http://wiki.rubyonrails.com/rails/pages/HowtoSetDefaultTimeZone
...which explains how to set the default timezone. I''m using an
environment.rb that include the lines:
ActiveRecord::Base.default_timezone = :utc
ENV[''TZ''] =
2006 Jun 08
5
Suggestions wanted for non-logged-in user in closed beta phase
Will shortly be deploying first iteration of app to some beta testers
(i.e. friends), and want them to be able see it both from logged-in view
and guest (i.e. not logged-in) view. The two are a fair bit different.
It''s a closed beta, so (hopefully) no pages (other than a blank login
page) will be visible.
The question is, what''s the best way for them to be able to see (and