similar to: Creating Methods in the Model?

Displaying 20 results from an estimated 4000 matches similar to: "Creating Methods in the Model?"

2009 Apr 29
1
Driving me nuts!!! - Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
I had to put a new HD in, and now I''m reinstalling everything, and can''t get mysql to fully work. I can''t remember how I fixed it. I''ve searched everywhere online and can''t find anything. when I try to use the >mysql command I get this: Can''t connect to local MySQL server through socket ''/tmp/ mysql.sock'' (2) My first
2009 May 13
4
Setting flash notice via javascript?
I am using a javascript to redirect to another action. Is there a way to set the flash [:notice] in the javascript? So when the javascript redirects, the new action/view picks up the flash[:notice]? (I suspect I may have to do something like url?notice=.....) ideas? thanks.
2006 Apr 10
3
Problems with multiple ActiveRecords and Validations
Hi all, I am a RoR newbie and have the following scenario set up: There are 2 ActiveRecords involved, the first one being "User", the second one being "Visibility". The corresponding users table holds address informations regarding a User. The visibilities table holds visibility settings for the individual columns of the users table (i.e. firstname, lastname, country
2009 Apr 09
4
create_table with unique combo
I need to create a table replacing default integer id with a string id and making a combo of (id and version) unique primary key. Here is what I''ve got so far. class CreateCatalogs < ActiveRecord::Migration def self.up create_table :catalogs, :id => false do |t| t.string :id, :limit => 20, :null => false t.string :version, :default =>
2006 Mar 24
3
String manipulation
I need to make some nicenames from my post titles, like: - convert spaces to "-" - delete all the !,?,commas,.,;.:,* from the string How can I do? Sorry for the noob question... Oh, and another thing... How can I make permalink this way: Not .../blog/show/4 but .../category/nicename ? Thankyou. -- Posted via http://www.ruby-forum.com/.
2009 Jan 23
3
Bug regarding ActiveRecord and TimeWithZone
I''ve discovered a strange behavior regarding ActiveRecord and TimeWithZone I''ve seen the error when using SQL Server, I have not yet tried with any other database. Here''s output from the console - "User" is a simple model made with a migration. ----------------------------------------- >> d1 = User.find(:first).created_at => Thu, 21 Jun 2001
2009 Nov 26
9
ActionView::TemplateError (can't convert ActiveRecord::Error into String)
I cannot work out why this error is appearing. ActionView::TemplateError (can''t convert ActiveRecord::Error into String) on line #3 of app/views/button/_show_enquiry.html.erb: 1: <h1>Send us a message</h1> 2: <% remote_form_for :enquiry, :url => {:action => ''send_mail''} do | f| %> 3: <%= error_messages_for ''enquiry'',
2006 Jul 29
3
Validating two models
Hi, I have a model Account wich "has_one" model called UserData. Both models use validation. # Model contains user name, email etc. class Account < ActiveRecord::Base has_one :user_data, :foreign_key => "user_id" validates_presence_of :email end # Model contains firstname, lastname etc. class UserData < ActiveRecord::Base
2018 Sep 29
3
Authenticate users using their firstname
Hi, I'm setting up a Postfic and Dovecot with LDAP email server. My users in LDAP is like this: dn: uid=firstname,ou=People,dc=domain,dc=com uid: firstname uidNumber: 4025 gidNumber: 4025 givenName: firstname objectClass: top objectClass: person objectClass: posixAccount objectClass: shadowAccount objectClass: organizationalPerson objectClass:
2018 Oct 01
2
Authenticate users using their firstname
> On 01 October 2018 at 15:19 Steffen Kaiser <skdovecot at inf.h-brs.de> wrote: > > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Sat, 29 Sep 2018, Fady AL HAYALI wrote: > > > I'm setting up a Postfic and Dovecot with LDAP email server. My users in LDAP is like this: > > > > dn: uid=firstname,ou=People,dc=domain,dc=com > >
2006 May 19
1
validates_presence_of and ajax-forms
Hi. I have "validates_presence_of :login, :password, :firstname, :lastname" in my user-model. I enter the information in new_user.rhtml: <%= error_messages_for(:user) %> <%= form_remote_tag :url => { :action => :register }, :html => { :id => ''new_user'' } %> I have a register.rjs with :fade. Omitting firstname or any other required field
2009 Aug 25
5
uninitialized constant
API-> hello_message_api.rb. class HelloMessageApi < ActionWebService::API::Base api_method :hello_message, :expects => [{:firstname=>:string}, {:lastname=>:string}], :returns => [:string] end controller -> class HelloMessageController < ApplicationController web_service_api HelloMessageApi web_service_dispatching_mode :direct wsdl_service_name
2006 Jul 26
2
Question about Recipe 52
I''m reading Rails Recipes, for the precision the recipe 52 that speak about ''Making your own Rails plugin''. The question, so stupid, is that i don''t understand wath do the code def self.search(query, fields, options = {}) find :all, options.merge(:conditions => [[fields].flatten.map { |f| "LOWER(#{f}) LIKE :query"}.join(''
2018 Oct 01
1
Authenticate users using their firstname
On Mon, Oct 01, 2018 at 11:25:48PM +0200, Admin wrote: > > > Von unterwegs gesendet > > > Am 01.10.2018 um 18:27 schrieb Aki Tuomi <aki.tuomi at open-xchange.com>: > > > > > >> On 01 October 2018 at 15:19 Steffen Kaiser <skdovecot at inf.h-brs.de> wrote: > >> > >> > >> -----BEGIN PGP SIGNED MESSAGE----- >
2015 Jan 19
1
dsadd doesn't work correct
Hi together, I installed samba 4 on a server with Debian-Wheezy-OS. Everything seems to work fine. I can add a user with RSAT. The user is added to the AD, the profile is stored in the server-profile-path and homepath can be accessed. I have to import about 400 datasets to the AD. Therefore I want to use the commandlinetool dsadd. With this tool I can import datasets, which I can see with RSAT.
2006 Mar 02
3
Custom SQL Question
Hello, can search with following SQL Statement: def execute_search @result = Search.find_by_sql ["SELECT * FROM customers WHERE firstname LIKE ? LIMIT 10",params[:firstname]] render :template => "search/resultlist", :layout => false end My question is, how do I use 2 or more Parameters - and with the "%"? (I Like to use SQL-Statements because
2009 Feb 19
8
validate for street
Hallo all, can someone tell me what can be the regulare expression for this: "The Road", "The Road 12", "Road", "On the Road 89". -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this
2004 Oct 23
1
login with alias
Hi all, i'm setting up mail server and here is the question: if, for example "firstname.lastname at domain.com" is e-mail address, then how can i setup login as "firstname.lastname" and "password" not only "firstname". Of course, users want all things simple. But i don't want to use login names longer than 8 chars. Any ideas? Or should i try
2006 Jan 05
7
HOWTO: Combine fields from 2 two tables in 1 object
Hi all, For a dropdownlist (showing "Company - FirstName Lastname'') I want to fill an object @project_contacts with "Name" from table Companies and "Firstname" and "Lastname" from table contacts. Any idea? Regards, Gerard. -- "Who cares if it doesn''t do anything? It was made with our new Triple-Iso-Bifurcated-Krypton-Gate-MOS
2006 Jul 17
14
REST Relationship Models
I''m trying to figure out an elegant way to do this: I have the following three tables: people, employer, employees And consequently the following three models: class Person < ActiveRecord::Base end class Employer < ActiveRecord::Base has_many :employees end class Employee < ActiveRecord::Base belongs_to :person belongs_to :employer end I want to be able to say: