Displaying 20 results from an estimated 5000 matches similar to: "Knowing id before a call to save"
2006 May 14
4
script/console on windows
Hiall,
When I try to run script/console from a windows command line like
f:\rails_app\ruby script\console
I get the following error:
F:/Programme/Ruby-1.8.4/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require__'': no such file to load -- initializer (LoadError)
from F:/Programme/Ruby-1.8.4/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require''
2006 Jun 14
5
InstantRails Lost connection to MySQL server
Hiall,
I just tried out InstantRails version 1.3a. After a virgin install and
filling the fresh mysql db with my app schema, I tried runningthe app
with webrick, only to see the infamous "Lost connection to mysql
server" for every action. What is it that I''m doing wrong? I also have
mysql 5 installed on my machine, but the service is stopped while
experimenting with
2006 May 18
6
Form actions with additional parameters
Hiall,
I want to give the action of a form an additional parameters but can''t
figure out how to do it. My code looks like this
<%= start_form_tag :action => ''create'', next_step => true %>
<%= render :partial => ''user_form'' %>
<%= render :partial => ''community_form'' %>
<%= submit_tag
2006 May 01
7
ActiveRecord and Database Views
Hiall,
If I have say 10 tables that i would like to wrap up in 1 view to
manipulate data inside these tables, do I then need 10 model.rb files
for all 10 tables plus 1 for the view, or do I just need 1 model.rb
file for the view ?
cheers
Martin
2006 Feb 27
8
Change Bit Value To Text When Viewed
Hey All, very simple question for you folks ;)
I have a @commutes object that for each record there is a bit value set
(0/1) to denote if an accident occurred. What I want to do is have it
display "Yes" or "No" when I view the listing of commutes. I can get it to
display the bit value just fine with <%= commute.accident %> but how can I
get it so that when a record with
2006 Jun 04
4
directory structure on typo
i was looking through the typo code and see that all of the
administrative controllers and views are placed in another subfolder. i
tried just moving the files just for kicks and it didn''t work (didin''t
really expect it to, but it was worth a shot.)
so how do you set something up like that? i tried looking in the
routes.rb file, but i''im not sure what''s in
2006 May 25
21
Converting HTML into an Image
I have this challenge of converting a bit of html into an image file
and then shrinking it into a thumbnail. The shrinking part shouldn''t
be too bad, but what advice can you give on converting the html to the
image? My thinking is that I will need to convert it to postscript or
latex and then convert it to an image from there. Is there an easier
/ better approach?
Michael
2006 May 14
6
file and directory layout below app/models
Hiall,
Is it possible to organize my model files below app/models into
subfolders? E.g. I would like to put admin related models into their
own subfolder. This kind of structuring works for controllers and
views (scaffolding creates the right subfolder-model mappings), but
app/models always stays flat. I''d really like to be able to group my
code into logical, well packages :-) Yes, I
2006 Apr 19
5
new article up at Linux Journal
http://www.linuxjournal.com/article/8993
If you''ve got feedback, requests for coverage, etc. please let me
know. I''ll try to respond in an upcoming column.
--
thanks,
-pate
-------------------------
http://on-ruby.blogspot.com
2006 Feb 17
4
link_to_remote doubles border size
I have a div with a border around it. I use link_to_remote to change the
content, and the border size doubles. Example:
<div id="test" style="border:solid; border-width:5px">
<%= link_to_remote("Test", :update => "test", :url => { :controller =>
"tester", :action => "test" }) %>
</div>
Even stranger, if I
2006 May 22
15
collection_select default selected value
Hiall,
Unfortunately I just can''t find out how to setup a default selected
value when using collection_select. My call is like so:
<%= collection_select(:consultant, :lastname, @consultants, :id,
:lastname, { :selected => @current_consultant.id } ) %>
which is not working, I debugged so far that I know that
@current_consultant.id contains the correct value.
Any tips?
cheers
2006 Feb 25
5
WEBrick Bad File Descriptor Error
All of a sudden I have a wierd error when running script/server on a
Windows XP box. Webrick is failing with a bad file descriptor error.
I''m sure it''s conflicting with something in my enviornment, but I
cannot figure out what. I googled the issue and haven''t been able to
find any answer for it.
Although, I did find a workaround. If I''m using a port above
2006 Jan 30
14
RoR admin system
I''m preety new at RoR (and programming), I tried a few tutorials, and
really like the RoR simplicity, but my knowledge of the framework still
isn''t very good (to be true, i understand the basics, but not everything
that''s in the tutorials).
But still I''d like to create a website which has:
- front end interface (with no edit functions)
- admin interface
2006 Apr 13
10
Code Igniter
Hi all,
I was just made aware of this:
<http://www.codeigniter.com>
I wonder where the inspiration comes from? Lots of very similar
concepts there ;)
I''ve only watched the intro movie so far, but very interesting.
jt
2006 May 09
3
Named link to image
Hiall,
Call me stupid if you like .,) but it seems i can''t figure out how to
get a named link using a combination of link_to and image_tag. What I
need is basically a link displaying a name along with some image to
indicate status (open,working,finished). I found no combination of
link_to and image_tag that accepts a name, this seems to be solely
used for making whole images into links
2006 May 18
3
ActiveRecord after save new and old values
I want to write a function that after an ActiveRecord saves
successfully, can show me what the before and after values of a
particular column are. Is this possible without creating a separate
object before modifying the current one?
-John
2006 Jun 01
3
Requiring /lib files in a cross-platform way.
Hi.
When you have library foo.rb in your Rails project /lib directory, I
notice that on some platforms - e.g. Windows with WEBrick as a server
- you can require it by simply:
require ''lib/foo''
However on other platforms - e.g. Debian with Lighttpd server via
FastCGI - this does not work, and you need to specify RAILS_ROOT
explicitly, like this:
require
2006 May 23
3
image_tag problem
Hiall,
I want to make an image_tag from within a controller in order to be
able to present a link (with a status image) in a view. Here is my
controller method (in file webca_controller.rb, hence WebcaController)
def untouched_status_image_tag
image_tag("open", { :alt => "Offen", :title => "Offen", :size =>
"12x12", :class =>
2006 Sep 15
2
Caching::Sweeper Access to Controller
Hello,
I''m running Mongrel 0.3.13.3, cluster 0.2.0, and Rails 1.1.6 and I
have a problem with a sweeper not having access to the controller
instance.
NoMethodError (undefined method `session'' for nil:NilClass):
/app/models/audit_sweeper.rb:16:in `log''
/app/models/audit_sweeper.rb:9:in `after_update''
2006 Feb 20
7
Native erb lacks -%>, where is Rails'' erb?
Native ERB in ruby, and eruby, seem to lack the -%> feature for
suppressing trailing newlines. Thus
erb -n script
gives errors. Where is Rails ERB so I can invoke it directly?
Thank you
Hugh