Displaying 20 results from an estimated 6000 matches similar to: "Why doesn''t it print out username?"
2006 Jan 09
6
has_and_belongs_to_many :self
Hi all
I got the following class:
class Member < ActiveRecord::Base
has_and_belongs_to_many :buddies,
:class_name => ''Member'',
:join_table => ''members_have_buddies'',
:foreign_key => ''member_id'',
:association_foreign_key =>
2006 Jan 23
5
validates_uniqueness_of :username, :if => !self.new_record?
Hi all
I want users to register on my page. To register, they only have to
deliver an email and a password. Then a link with an activation token
will be sent to them, and after clicking the link the user sees a page
where he should fill in further details, means: a username.
My model looks like this:
class Member < ActiveRecord::Base
validates_presence_of :username, :if =>
2006 Jan 11
4
Member.buddies.sort >> undefined method `<=>''
Hi all
I have a model Member that has a habtm relationship to buddies (also
members).
Now I wanted to sort them using sort, but this ends in an error
"undefined method <=>"! Where''s the problem here? Sorry, I''m still
beginning to learn Ruby. ;-)
Thanks
Josh
--
Posted via http://www.ruby-forum.com/.
2006 Jan 11
8
GetText: Works with en_GB and en_US, but doesn''t with de_DE!
Hi all
I''m trying to get GetText to work. I have the following folder
structure:
|-myapp.pot
|-de_DE/:
| `-myapp.po
|-en_GB/:
| `-myapp.po
|-en_US/:
` `-myapp.po
I run rake updatepo, and then rake makemo.
Now I set en-gb as default language in Firefox and run my app >> works!
Then I set en-us as default language in Firefox and run my app >> works,
2006 Apr 01
5
Upload a zip using a form and extract if afterwards on srv?
Hi all
It like my visitors to be able to upload a zip file (or any other
possible compressed file archive) to my server. After upload, my web app
should extract the content to the server and delete the zip file.
Is this possible somehow? I''m very thankful for help.
Have a nice weekend,
Joshua
--
Posted via http://www.ruby-forum.com/.
2006 Jan 12
9
Scaffold shows all attributes altough I use attr_accessible!
Hi all
I have a Model like this:
class Member < ActiveRecord::Base
attr_accessible :username, :email, :first_name, :last_name
end
I have created a scaffold using script/generate scaffold member members
Using the URL localhost:3000/members/edit/1 I can edit all attributes,
including created_at, lock_version etc.! But it should only show the
attributes I listed in attr_accessible!
What
2009 Oct 13
9
Nokogiri: to_s WITHOUT html surrounding's tags?
Hi all
n = Nokogiri::HTML("<h1>H1</h1>")
n.to_s
# => <!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"
\"http://www.w3.org/TR/REC-html40/loose.dtd\">\n<html><body><h1>H1</h1></body></html>
Is there a method that only outputs the stuff I''ve read, and not the
whole valid XHTML stuff?
2008 Jul 30
4
AssociationTypeMismatch: Genre expected, got String
Hi all
I have the following 2 models:
class CompactDisc < ActiveRecord::Base
belongs_to :genre
end
class Genre < ActiveRecord::Base
has_many :compact_discs
end
I have created a select box for my form so I can choose a genre for
every compact disc:
<p>
<b>Genre</b><br />
<%= f.select :genre, Genre.find(:all).collect{|p| [p.name, p.id]},
:selected =>
2006 Jan 11
7
before_filter: how to give :except more than 1 value?
Hi all
I have the following class:
class MemberController < ApplicationController
before_filter :authorize, :except => :index
def index
...
end
Now I want to give the before_filter more than one :except argument. I
tried :except => {:index, :login}, but this didn''t work.
How can i accomplish this?
Thanks a lot and have a nice day,
Josh
--
Posted via
2006 Jan 24
9
ActionMailer: Mail isn''t delivered
Hi all
I used the search for this, but I got an Application Error, so sorry for
the newbie question.
I have tried to send an e-mail using ActionMailer. I have to following
config (environment.rb):
ActionMailer::Base.server_settings = {
:address => "mail.psyguide.org",
:port => 25,
:domain => "mail.psyguide.org",
#:authentication => :login,
#:user_name
2006 Mar 21
5
Use select_date for my model?
Hi all
I have a model "party" that has a time field "starts_at". I have created
a form to add new instances of this model.
<%= select_date Date.today, :prefix => ''party'' %>
Sadly I get the error:
NoMethodError in Parties#add
undefined method `month='' for #<Party:0x256a600>
How can I fix this problem? I remember that I saw in
2006 Jan 19
5
123 * 3 => 123123123! But why?
Hi all
I extended the Globalize Plugin the following way:
--------
module Globalize
class Currency
def conversion_rate
code = Locale.active.currency_code
rates = { :USD => 1,
:CHF => 0.75,
:EUR => 1.1,
:GBP => 3.1
}
value = rates[code.to_sym]
raise "No conversion rate found for currency
2007 Apr 01
7
database.yml: encoding: utf8 does not work
Hi all
According to the Agile 2nd Ed book I added the line encoding: utf8 to my
database.yml connections.
But now when running rake I get plenty of errors:
Character set ''utf-8'' is not a compiled character set and is not
specified in the ''/usr/local/mysql/share/mysql/charsets/Index'' file
What''s wrong here?
I checked this Index file, but it seems to
2006 May 16
5
rake aborted! ActiveRecord::ConnectionNotEstablished
Hi all
I''m just learning to use rake and ran into the following problem:
chraftbuech:/Users/Josh/Webwork/CommentingSystem josh$ rake
create_test_news
(in /Users/Josh/Webwork/CommentingSystem)
Create test news
rake aborted!
ActiveRecord::ConnectionNotEstablished
The task''s code is:
desc ''Creates some test news items with comments''
task
2006 Jan 29
9
Specify options with habtm
Hi all
I have the following models:
class member
has_and_belongs_to_many :disc_jockeys
end
class disc_jockey
has_and_belongs_to_many :members
end
The relation table is called disc_jockeys_members and has the following
fields:
disc_jockeys_members(disc_jockey_id, member_id, status)
So far, the field status can have values like valid, invalid, locked
etc., but it is not regarded yet by
2006 Feb 27
4
2 belongs_to to the same parent table
Hello!
I have 2 table: users and buddies
User: id, name, ...
Buddy: id, user_id, user_buddy_id, ...
So if you have 2 users 1,jack and 2,fred and fred is a buddy of jack,
there is a Buddy object: id=1, user_id=1, user_buddy_id=2
I can declare only one belongs_to in Buddy and one has_many in User. And
there is conflict if I had the second one (the first one is discarded)
class User
has_many
2008 Jul 15
3
Bug-buddy and bug reports for GNOME 2.16...
There seems to be some hostility to the idea of this being a GNOME or
Evolution problem:
Bug 542280 ? Refuses to report bugs because gnome 2.16.x is too old
View Bug Activity
Product: bug-buddy
Component: general
Version: 2.16.x
Status: RESOLVED
Resolution: WONTFIX
Opened by Mark Hull-Richter (reporter, points: 3)
2008-07-09 23:40 UTC [reply]
On CentOS 5.2 (and 5.1 and 5.0, and Red Hat
2012 Sep 11
1
multiple users for jabber.conf
Hi all,
Been reading about chan_motif / chan_xmpp in the wiki's for 1.8, 10 and
11 version of asterisk.
In each example i got the impression that the asterisk server is
registering on a XMPP server as a single user with the credentials as
specified in jabber.conf.
Instead of a single xmpp-user, could that also be multiple users?
For instance, for each sip-user an xmpp-user?
When i skim
2016 Apr 05
2
[PATCH v3 01/16] mm: use put_page to free page instead of putback_lru_page
On Mon, Apr 04, 2016 at 04:46:31PM +0200, Vlastimil Babka wrote:
> On 04/04/2016 06:45 AM, Naoya Horiguchi wrote:
> > On Mon, Apr 04, 2016 at 10:39:17AM +0900, Minchan Kim wrote:
...
> >>>
> >>> Also (but not your fault) the put_page() preceding
> >>> test_set_page_hwpoison(page)) IMHO deserves a comment saying which
> >>> pin we are
2016 Apr 05
2
[PATCH v3 01/16] mm: use put_page to free page instead of putback_lru_page
On Mon, Apr 04, 2016 at 04:46:31PM +0200, Vlastimil Babka wrote:
> On 04/04/2016 06:45 AM, Naoya Horiguchi wrote:
> > On Mon, Apr 04, 2016 at 10:39:17AM +0900, Minchan Kim wrote:
...
> >>>
> >>> Also (but not your fault) the put_page() preceding
> >>> test_set_page_hwpoison(page)) IMHO deserves a comment saying which
> >>> pin we are