Displaying 20 results from an estimated 5000 matches similar to: "'get_user_list' function not working"
2006 Jul 14
1
creating a computed column with activerecord for to_xml
Hi. I have a question about activerecord, computed columns and to_xml. 
I have a simple model called person that has a first_name and a 
last_name field (and thus a first_name and last_name field in the Person 
table).  When I :find a model and call to_xml, I would like the result 
to not only send back first name and last name as xml but also add an 
additional attribute called full_name that is
2013 Jun 18
0
language specific email templates
Hi,
I am new to Asterisk. I'm using it behind a kamailio sip-router to provide voicemail boxes to sip-users.
I followed these instruction: http://www.voip-info.org/wiki/view/Realtime+Integration+Of+Asterisk+1.4+With+Kamailio+1.5.x
to set everything up, using ARA with a MySQL DB.
After a few tweaks "everything" is basically working, however, a few questions remain that I could not
2006 Mar 16
6
How to have multiple fields appear in collection_select?
I have a table of employees with the fields "last_name" and 
"first_name". I would like to populate a collection select so that what 
the user sees in the drop-down is "Last Name, First Name".  So far, the 
only way I have figured out to do this is by using "find_by_sql" in my 
model, like so:
@employees.find_by_sql("SELECT id, concat(last_name,
2006 Jul 22
3
refactoring commonly used aggregations
I have a number of models that use an aggregation to combine First Name,
Middle Initial and Last Name and they have been working fine. I am
looking to clean this up, DRY it if possible.
I have things like this in application.rb
class Clwholename
  attr_reader :first_name, :middle_initial, :last_name
  def initialize(first_name, middle_initial, last_name)
    @first_name = first_name
   
2006 Mar 20
2
AHHHhhhhh... has_and_belongs_to_many, that is going on?
I don''t have a class by the name of "ReviewersScoreCard", yet my many to
many configuration looks as follows. And, these errors while running some
simple test with ./script/console is giving me a headache:
./script/console
Loading development environment.
>> r = Reviewer.find_first
=> #<Reviewer:0x19d0a48 @attributes={"id"=>"1",
2006 Jan 19
2
Simple Ferret Questions
I am trying to use Ferret for searching for users based on first and last name.
In my index, I am adding the first_name, last_name, and a full_name
which is basically "#{first_name} #{last_name}".
I am searching the index using something like the following query:
INDEX.search_each(%Q/first_name:#{query}* OR last_name:#{query}* OR
full_name:#{query}*/) do |doc, score|
The problem I am
2006 Aug 07
3
wrong number of bind variables
I''m getting this error message since i moved alot of the database
logic to the model.
wrong number of bind variables (0 for 2) in: first_name = ? AND last_name = ?
def self.authenticate(first_name, last_name, password)
    user = User.find(:first, :conditions => [''first_name = ? AND
last_name = ?''])
    if user.blank?
      Digest::SHA256.hexdigest(password +
2007 Aug 26
2
Multi-word query searching across columns
I''m trying to implement a basic name search on a People table with
separate first_name and last_name columns. I am using the
will_paginate plugin and have the following search method in the
model:
def self.search(search, page)
    paginate :page => page,
                     :conditions => ["lower(last_name) like ? or
lower(first_name) like ?",
2007 Nov 06
2
Why is this view spec failing?
I can''t figure out why I am getting a failure.  It renders out fine in
the browser.
<h1>New member</h1>
<%= error_messages_for :member %>
<% form_for(:member, :url => members_path) do |f| %>
  <fieldset>
    <legend>Member Info</legend>
    <p><label for="member[first_name]">First Name:</label>  <%=
2006 Aug 07
2
Bind variables error
wrong number of bind variables (0 for 2) in: first_name = ? AND last_name = ?
I''m not sure why I"m getting this error ?
def self.authenticate(first_name, last_name, password)
    user = User.find(:first, :conditions => [''first_name = ? AND
last_name = ?''])
    if user.blank?
      Digest::SHA256.hexdigest(password + user.password_salt) !=
user.password_hash
   
2006 Mar 30
6
MS SQL query strangeness for ActiveRecord in Rails
Hi,
I am currently trying to move my rubyonrails app from Linux to Windows 
server utilizing MS SQL instead of MySQL due to "business" reason. All 
my listing screen utilize a drop down list in each column to allow user 
to "filter" the listing based upon the value chosen from the drop down 
list. In the controller, I used find() method but with customized 
parameters such as
2006 Aug 11
0
SQL sort
in my list action, I setup the sort parameters as folows :
..
     sort = case @params[''sort'']
            when "login"  then "login DESC"
            when "first_name"   then "first_name DESC"
            when "last_name" then "last_name DESC"
            end
...
to be used in a ''sort_link_helper''
 
2005 Dec 31
0
:prompt not working?
Hi all,
I''m trying to use the { :prompt => true } option in an erb form.
However, not extra option-tag is prepended to the select list. Am I
doing something wrong? (Code snipper follows.)
<%= select :user, ''person_id'', Person.find(:all, :order => ''last_name,
first_name'').collect {|p| [ p.fullname, p.id ] }, {:prompt => true} %>
Thanks,
2006 Jan 03
0
has_and_belongs_to_many include problem
hey,
i have users who are in groups, and i have a search form, where i can search on
group, user lastname, and user firstname.
All this is also with pagination.
these are my models
class User < ActiveRecord::Base
has_and_belongs_to_many :groups
end
class Group < ActiveRecord::Base
    has_and_belongs_to_many :users
end
in my controller i do this
THIS works (but in need pagination)
@users2
2010 Mar 26
2
How to read a xml file?
How to read a xml file?
I have this XML source:
-------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fichas>
  <ficha>
    <nombre>Gabriel</nombre>
    <apellido>Molina</apellido>
    <direccion>Alfredo Vargas #36</direccion>
  </ficha>
 
2014 May 29
0
How to make the tests pass in an elegant way? Ruby on Rails
I am writing a rails app with my colleague who wrote a lot of the tests.
He had to take a leave of absence due to a death in his family, and I am
needing helps with changing the model so that the tests will pass in our
spec file.
Here is the model:
    class Worker < ActiveRecord::Base
      attr_accessible :first_name, :last_name
      has_many :writings
    end
Here is the spec:
   
2010 Oct 05
2
Is it possible to query on virtual attributes?
I have a Person model with attributes first_name and last_name.
I want to implement autocomplete search that looks that the entire
name. Hence I have a method:
def full_name
   self.first_name + " " + self.last_name
end
Is it possible for me to query on full_name and have rails match the
first_name and last_name fields?
I currently receive this error when I try, because full_name
2009 Nov 06
0
Nested objects not propagating from view
I thought I had this fixed, but apparently not. It works okay from the
console, but not from the view. I have the following:
  # partial schema
  create_table "users", :force => true do |t|
    t.string   "login",      :null => false
    t.string   "first_name"
    t.string   "last_name"
    t.string   "email",      :null => false
   
2014 Apr 21
0
Unpermitted Parameters - Rails 4
Hi,
I'm using Devise (3.2.4), Rails 4 and I'm trying to signup.
I have a Registration Controller where i do have:
"
def sign_up_params
             params.require(:user).permit(:email,:first_name,
:last_name,:mobile, :birthday, :current_password,
:password,:password_confirmation)
         end
"
and everytime i try to sign up I get the following message:
Processing by
2006 May 17
5
text_field_with_auto_complete (newbie question)
I have the text_field_with_auto_complete woking on my user DB using
last_name. so looking for ''ivanoff'' works great, but I can''t find
''john''. Plus I like to have ''last_name, first_name'' show up in the
dropdown.
what I can''t figure out is how to concat first_name and last_name to
make a name and use that to look it.
working