Displaying 20 results from an estimated 700 matches similar to: "rake create_sessions_table, does not create session table"
2006 Jan 22
9
ERROR: undefined method `h'' for ERB::Util:Module
ERROR: undefined method `h'' for ERB::Util:Module
i get above error when i use
ERB::Util.h(content)
in my controller''s action.
can any one one tell me how to use this ''h'' method within controller?
thanks,
Jigar Gosar
http://jigar.org
--
Posted via http://www.ruby-forum.com/.
2006 Jan 14
4
hide_action doesnot hide view
The view file (eg. apps/views/items/list.rhrml) is still displayed even
when the action is hidden (hide_action :list). How can I hide view file
form being automatically displayed in this circumstance?
thanks,
jigar
--
Posted via http://www.ruby-forum.com/.
2007 Aug 25
5
How do I assign default values to model attribute
I have a model with a attribute named "code". Every time i create an
instance I want the "code" to be initialized by making a call to
"generate_code" method. How do i initialize model attributes in rails ??
thanks for help.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are
2006 Apr 07
2
weird error with rake create_sessions_table
Hi all,
Despite switching to mod_fcgid (which has improved performance),
sessions are still expiring sporadically. I thought I might try
switching to storing them in the db, but I get the following error when
I try to run the rake create_sessions_table command
D:\User\Code\ruby\prometheus>rake create_sessions_table
(in D:/User/Code/ruby/prometheus)
rake aborted!
undefined local variable or
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
2007 Jun 24
1
Cant test 404 pages in webrick
I tried running webrick in production mode with -e production option. I
changed development database name so as to make sure webrick was running
in production mode.
Now I wanted to test my new 404.html page so I typed an invalid URL, I
still get some routing error instead of my 404.html page.
Why is this happening with webrick in production. I haven''t even changed
any of the environment
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 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 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 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/.
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
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:
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 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 May 24
1
Best practices: a little pop-quiz on my blog
Hey,
I just put up a little rails pop-quiz on my blog (more fun than just
writing a post saying "hey did you know...").
Seeing as it''s probably of interest to more than just the three
people (including my wife) that actually read my blog I figured it
would be okay to announce it here.
http://tinyurl.com/prxdl
I''ll post my answers in a followup tomorrow
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 Dec 11
7
Catching Exceptions in ActionController
I''d like to be able to catch ActionController::MissingTemplate
exceptions from within ActionControlle, *but*, MissingTemplate isn''t
defined within my controllers!!!
How is that possible - after all, all controller subclass
ActionController, so how are exceptions it defines not there!?
More importantly, how can I do this?
--
Posted via http://www.ruby-forum.com/.