Displaying 20 results from an estimated 5000 matches similar to: "Problem connecting to MySQL"
2010 Dec 30
6
validates_inclusion_of doesn't match constant
Hello, I have a model Model:
SPECIAL_FEATURES = %w(none top)
class Model
validates_inclusion_of :special_feature, :in =>
Model::SPECIAL_FEATURES,
:on => :create, :message => "special_feature
%s is not defined"
belongs_to :team
def special_feature
attributes = attributes_before_type_cast
if attributes["special_feature"]
2005 Jun 23
6
Problems with Hello World
Hello, I''m installed RubyOnRails in my Fedora Core 4 system.
I''ve created an empty web application with:
rails cookbook
then a controller
ruby script/generate controller MyTest
And a file named my_test_controller.rb was created at
cookbook/app/controller directory.
I ''ve written a new method for MyTestController class like:
def index
render_text "Hello
2008 Aug 24
11
link_to_function check javascript attribute
How could I check the value of an javascript object''s attribute?
<div id="new_item_details" style="display:none"></div>
<%= link_to_function("Show details...", nil, :id => "show_details") do
|page|
page.visual_effect(:toggle_blind, :new_item_details)
if (page[:new_item_details].style.visibility ==
2008 Jul 04
4
Libs directory
Hello,
I had an application on Rails 1.2 or 1.1 (don''t remember). Now I have
updated it to 2.1.
I had a migrations_helper.rb in the Libs directory which defined
foreign_key and drop_foreign_key methods. But now migrate task doesn''t
find them. Have I to include this directory somewhere with Rails 2.1?
Doesn''t it work as always?
Could I use another thing to declare
2006 Jul 13
6
Migrations + foreign keys
Hi all,
In the AWDR author use the execute method to declare foreign keys:
execute "alter table.... add constraint.... foreign key...."
Is there a ruby sintax to declare a foreign key in a migration class?
--
Posted via http://www.ruby-forum.com/.
2008 Jan 27
4
(REST) Nested routes
Hello, I''m in troubles with nested routes. I have three models: Team,
Tournament and TeamTournaments
class Team < ActiveRecord::Base
has_many :tournaments, :through => :team_tournaments
has_many :team_tournaments
class TeamTournament < ActiveRecord::Base
belongs_to :team, :foreign_key => ''team_id''
belongs_to :tournament, :class_name =>
2007 Mar 08
3
Problem loading data from database
Hello, I get this error trying to load some data from DB. I''m using
Rails 1.2.2 on Fedora Core 6 and Sybase adapter.
This worked fine when application run under Rails 1.1.6 but now I''m
migrating to 1.2.2 and have some problems.
At browser I got:
SQL Command for table_structure for tplib_bckps failed
Message: schema_info not found. Specify owner.objectname or use
sp_help to
2006 Aug 14
2
Another try with REST
I''m using edge rails.
My routes.rb is:
map.connect '':controller/service.wsdl'', :action => ''wsdl''
# Install the default route as the lowest priority.
map.connect '':controller/:action/:id''
map.resources :team <---- THIS LINE ADDED BY ME
Also have a team_controller.rb, a team.rb model and scaffolding for it.
If I
2006 Jul 13
4
Regenerate DB
Hi again :),
I''m playing with migrations. I''ve created some migrations classes and
with
rake db:migrate the tables are created and altered fine, but then I
dropped
some of the tables and when I run db:migrate command again I don''t get
tables
being re-created.
What am I doing wrong? Is there a way to run db:migration in order to
drop the
tables?
--
Posted via
2006 Aug 01
1
SimplyRestful
Hi, Is it SimplyRestful compatible with Rails 1.1.4 or Would I need edge
Rails?
--
Posted via http://www.ruby-forum.com/.
2006 Aug 11
2
Some questions of REST actions
I''ve set up my application to use edge rails in order to get REST
functionality.
I''ve a controller called team (team_controller.rb) with some actions
(index, list,
show, create, new....). Moreover in routes.rb I''ve added
map.resources :team
so I guess I could call
localhost:3000/xxxx/team/1
or
localhost:3000/xxxx/team/1;edit
Well, when I do the first call, server
2008 Jul 24
1
How to add link_to_remote element with RJS?
Hello,
after executing an action, I add an <li> element to an existing list
using a RJS template:
page.insert_html :bottom, :contributors, "<li
id=''contributor.#{@contributor.id}''>#{@contributor.user.name}</li>"
but I need to add an image with a link_to_remote as I have in a
partial page:
<li id="contributor.<%= contributor.id
2006 Mar 14
7
Starting with RJS - not working
Hi,
I''m trying to work with RJS and folowed Cody Fauser''s tutorial
(http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates)
I''ve started by creating a new rails applications and executing
rake freeze_edge
rake rails:update:javascripts
rake rails:update:scripts
After that I''ve created a controller:
class DtestController < ApplicationController
2019 Jun 30
2
Dovecot/MSQL issue
Hello, I'm trying to work through an issue that cropped up on a server I've
been working on and haven't found a very good workaround.
Dovecot is operating in a jailed environment.
The configuration in dovecot-sql.conf.ext has been set appropriately with
the host=127.0.0.1 (which works from a jailed environment) and when dovecot
attempts to auth it appears to perform a reverse dns
2008 Oct 22
1
dovecot delivery log
Trying to debug a delivery problem recently (with Postfix) and I
realized that Dovecot wasn't logging any of the delivery information.
I'm using Postfix to recieve mail, which is passing it on to Dovecot's
deliver to actually deliver the emails into the mail boxes.
In dovecot.conf, I have:
protocol lda {
log_path = /var/tmp/dovecot-deliver.log
}
[root]# dir /var/tmp/
total 2
2013 Apr 15
8
[PATCH] btrfs-progs: No-op when called as fsck.btrfsck
Hi,
I thought that I would attempt a quick little patch that will make btrfsck into
a No-op when called as fsck.btrfsck.
The reasoning is that the FAQ states that it is recommended and safe to do so,
and the current 12.04 version of Ubuntu just symlinks fsck.btrfsck to btrfsck
instead of /bin/true.
PS - Apologies if I mess this git send-email up!
Dan McGrath (1):
btrfs-progs: No-op when
2006 Jan 16
15
where''d we come from?
I''m curious -- how many of us came to Rails from other branches of the OO
world -- Java, C# -- and how many of us came from the design or non-OO
scripting worlds?
Reason I ask is that I''m finding Rails a blast and very productive, but I
think one reason is that I already cut my teeth on MVC and ORM during two
years of writing apps with J2EE/Struts/Hibernate. And in Javaland, it
2006 Jan 19
4
create an object from a string?
I''m trying to dynamically create an instance of an object at runtime, from a
String. I have a method that returns one of a number of Strings ("Car",
"Motorcycle", "Bicycle"), and when I receive the String, I then want to
instantiate one of those objects.
Seems like there should be a way to do it in Ruby, but maybe I''ve been up
too long --
2023 Mar 22
2
[libnbd PATCH v4 0/2] lib/utils: introduce async-signal-safe execvpe()
On 3/22/23 15:45, Laszlo Ersek wrote:
> On 3/21/23 18:28, Eric Blake wrote:
>
>> it is indeed a bug in busybox now that POSIX is moving towards
>> standardizing realpath, so I've filed it:
>> https://bugs.busybox.net/show_bug.cgi?id=15466
>
> I've found another busybox bug.
>
> The "/bin/sh" utility is provided by busybox as well (via the
2006 Jan 14
11
nuby: do models have to inherit directly from ActiveRecord?
Hello,
I have a few models -- book, cd, dvd -- for which I''d like to have an
abstract base superclass to hold some common stuff. That abstract class, I
was thinking, would inherit from ActiveRecord.
Didn''t work, though, and looking around, I found this:
<http://wiki.rubyonrails.com/rails/pages/HowtoMakeAbstractModel>