Displaying 20 results from an estimated 30 matches for "gamsnjaga".
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 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 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 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 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 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 Apr 27
5
Realtime Form Validation Plugin Available
Granted, I''m still very much a newbie, but after reading an article on AJAX
that basically states at one point that just because you can use AJAX
doesn''t always mean you should, I have to ask: Why bother contacting the
server (even if it is an insignificant amount of bandwidth) to validate the
sanity of form data (unless you''re actually validating against something in
2006 May 18
4
Can I send rendered .html to somewhere besides the web server?
Is there any way to tell Rails to send the .html file it renders somewhere other than the web server? I need to save a page to the server''s file system instead of sending it to the user''s browser.
Thanks!
Bill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060518/facce47e/attachment.html
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 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 May 10
8
dynamic setting of username and password in database.yml
Hello
I''ve now read a lot about application-level authentication in Rails, but
I need to do database-level authentication.
The reason is that my database needs to have the current_user (database
current_user, not current_user defined in an ActiveRecord Model) set to
execute triggers for automatically updating audit tables. So it is not
enough to have a session check against a User
2006 Apr 18
7
Connecting to multiple databases
Hi Everyone,
I am trying to connect to multiple databases and followed along the
Recipe in Chad Fowlers ''Rails Recipes'' book (which basically is about
establishing the connection in a subclass of ActiveRecord::Base, and
inheriting all classes in need of this connection from this class)
Chad Fowler says:
"You won''t be able to instantiate an External, of course,
2006 Aug 17
1
Organizing the db/migrate folder
Hiall,
I was wondering how you guys are organizing your migrations files under
db/migrate? I have like 60 database tables initially, and if I exercise
migrations the way they should be exercised, I guess this will become even
more files ... Now maybe you say 70 files ain''t that much anyway :) but the
thing of course is that these files logically belong to different areas of
my
2006 Jun 12
0
Realtime form validation for forms containing collections
Hi,
I''m successfully using the realtime_form_validation plugin from
http://railsrtv.rubyforge.org/ However, my forms contain collections,
as described in the AWDWR book. Basically my form looks like this.
2004 2005 2006
Question 1 12 13 15
Question 2 9 11 13
I have the following code to generate ids for my input fields.
2006 Jun 17
0
Dynamic forms containing collections
Hiall,
I have the following problem: I need to use forms containing
collections (i will call them FCC), and I want to construct them
dynamically, as I need to deal with quite large forms (more than 600
input fields).
The variables @model_name and @field_name contain the proper model and
field names as strings, which is enough for "normal" form input
fields. (i.e. the "if
2006 May 14
1
Public class method ActiveRecord::Base.update
Hiall,
Given I use forms containing collections and use a statement like
Product.update(params[:product].keys, params[:product].values)
to update more than one product. What is the best way to determine if
this update operation was successfull? I read the apidoc and it says
that even if the save fails under validation, an array of products is
returned. Now do I have to loop through all those
2006 May 16
1
saving a has_one association question
Hiall,
Say I have
class User
has_one :community
end
class Community
belongs_to :user
end
Will the following work and both save user and community if validation
doesn''t fail?
user = params[:user]
user.community = params[:community]
user.save
Or do I have to do something like the following
user = params[:user]
if user.save
user.community = params[:community]
end
to be on the
2006 May 17
1
Experiences with ModelSecurity
Hiall,
I would be very interested in your opinions on the ModelSecurity
plugin by Bruce Perens.
http://perens.com/FreeSoftware/ModelSecurity/Tutorial.html
Some time ago, I read on a few pages that it is the way to go, on this
list however, I didn''t read much about it. Apart from it''s security
level,
quoted from comments in source code:
# FIX: At the moment we only support
2006 May 24
0
distance_of_time_in_german_words
Hiall,
This could be useful for those of you producing websites in the german
language. Basically I copied the definition of the rails builtin
distance_of_time_in_words and extracted another method
german_words_for_distance_in_seconds. Just put these e.g. into module
ApplicationHelper and you can use it in all views.
def distance_of_time_in_german_words(from_time, to_time = 0,
include_seconds
2006 May 24
0
Routes recognition problem
Hiall,
I have two modules for my controllers containing the following files
/app/controllers/admin/new_controller.rb
/app/controllers/admin/list_controller.rb
/app/controllers/admin/sidebar_controller
/app/controllers/community/input_controller.rb
/app/controllers/community/sidebar_controller.rb
Each of those controllers is declared with the appropriate module like so
class