Displaying 20 results from an estimated 7000 matches similar to: "Re: find_by_name won't return record id"
2010 Sep 12
11
Rails 3: finding a record by name in multilingual app
Hello,
I upgraded my application from Rails 2 to Rails 3 and ran into a
problem. In rails 2 I could use the english name of the record to find
it like:
Page.find_by_name("Welcome")
even though the user chose German as the language (which of course
showed the German welcome page.
Eversince I switched to Rails 3 (default_locale still :en) I can''t find
anything by giving the
2006 Jun 11
2
Finding a record and showing it -- how?
I''d like to prompt a user for the value of a Name field, then display
the record. Rails tells me that it cannot do a find without an ID. I
guess it must be that I''m not passing back properly the data from the
view to the controller.
Thanks for the help
joshi
The find_user.rhtml view:
<div class="find-name-form">
<fieldset>
<legend>Enter User
2005 Aug 19
2
FXO not picking up; baffled
I'm a newbie to Asterisk, but I'm moderately knowledgeable about phone
systems. Right now, I'm most certainly confused.
I have a TDM-04B (four FXO) and four analog FXO lines running into it
from an AdTran 616. I have Asterisk working internally, although I could
use some help getting incoming calls to answer properly and configuring
my outbound dialplan.
Here's where I'm
2009 Oct 08
6
Eager Loading a Relationship That Has No PK/FK
I''m attempting to wrestle an old DB into Rails.
This relationship is giving me trouble:
class Show < AR::Base
has_many :segments
end
class Segment < AR::Base
belongs_to :show
has_one :media #this has no PK/FK relation
end
A Segment is "linked" to Media by Media.name, which is the result of
concatenating Segment.name and Segment.part. As I said there are is no
2006 Jun 10
3
Weird Problem With Active Record
Is it me or is my model getting the created_at from the wrong model!
I have a HABTM relationship between Problems and Tags. In one of my
controller I do the following:
def view
@tag = Tag.find_by_name @params[:id]
end
In my view I do this:
<% @tag.problems.each do |problem| %>
...
<%= problem.created_at %>
...
<% end %>
Now, how come the created_at
2006 Aug 02
9
How to fetch the previous or next record
Hello,
Is there some built-in facility for fetching the Previous or Next record
from a table? Assume the command find_by_name has been issued, and the
variable @name contains the name "John Doe". I''m looking for something
like find_next(@name) and find_previous(@name). What''s a good way to
pursue if one has to roll their own methods?
Thanks for the help,
gk
--
2005 May 10
1
[S] Data sets from Chambers' green book?
Dear R and S people:
Yet another dorky question (YADQ), please:
Where can I find the data sets from Chambers' green book, please?
I've tried
http://cm.bell-labs.com/stat/Sbook
(web site, no data or even pointers....functions and articles...good ones)
http://cm.bell-labs.com/stat/project/icmanuf
no web site at all.
Thanks in advance!
2006 Sep 08
0
Ruby on Rails Job - Northern, VA
Send your reply to myitrecruiter-/E1597aS9LQAvxtiuMwx3w@public.gmane.org
Web Application Engineer
The ideal candidate will have experience developing
rich web applications (AJAX, XHTML, JavaScript, XML,
CSS etc). We are looking for candidates with strong
user-interface instincts.
The successful candidate will have a passion for
delivering high quality software and possess a high
degree of
2008 Feb 29
0
Net::LDAP
Hi All,
I am new to Ruby and doing some automation testing.
I am using Net::LDAP to connect to my ldap server
My script is
require ''rubygems''
require ''net/ldap''
ldap = Net::LDAP.new :host => ''10.44.169.24'',
:port => 389,
:auth => {
:method => :simple,
:username =>
2011 Jun 27
2
insert value of primary key into another field before record is saved
Hey all,
I created a seed task:
def books!
books = Book.where(:type_id =>
Type.find_by_name(''Fiction'')).order(''id'')
books.each do |book|
@books = 4.times.map do |i|
subbook! "#{book.book_num}-#{i}".to_s, :book_state =>
BookState[:available].id, :book => book
end
end
puts "log it:
2007 Jun 23
3
has_and_belongs_to_many and dynamic find
Hi
Just curious if anyone can explain why using a dynamic find fails to
work with << operator
I have standard habtm relationship
class User < ActiveRecord::Base
has_and_belongs_to_many :roles
Now when I assign a Role via << after saving the new User I get wierd
behaviour
but only when using the dynamic version of find
i.e
@user = User.new(p)
if @user.save
#
2012 Feb 07
1
alternating element in url
Hey everybody,
it would be really appreciate if you knew the solution to the following
problem.
I am trying to load data from the internet into R without having to save
them. However, I need to acess a different website for each dataset. So I
want to alternate an element in the URL. Eventually, I want to fill a 3
dimensional matrix/array where each slice is a two-dimensional matrix from
the
2008 Nov 28
1
Rails Beginner.. NoMethodError
Dear all
I encounter error when I login my Web application
NoMethodError in AdminController#login
undefined method `get_title'' for #<Class:0x63ac78>
Here is part of my code
controller/admin_controller.rb
def login
session[:user_id] = nil
if request.post?
if User.authenticate(params[:name], params[:password])
user = User.find_by_name(params[:name])
2007 Sep 20
1
Relationship Proxies?
I''m trying to understand these results in irb, which implies that
there''s some kind of proxy at play:
>> aaron = User.find_by_login ''aaron''
=> #<User:0xb7109cdc
@attributes={"salt"=>"7e3041ebc2fc05a40c60028e2c4901a81035d3cd",
"updated_at"=>nil, "contact_info_id"=>nil,
2013 Mar 28
1
undefined method 'sanitize_limit' for #<ActiveRecord::Relation:0x2aaaad35d720>
I am trying to upgrate rails from 3.0 to 3.1, while updating rails version
I am getting following error
rake aborted!
undefined method `sanitize_limit'' for
#<ActiveRecord::Relation:0x2aaaad35d720>
/some_package/lib/ruby/gems/1.8/gems/activerecord-3.1.12/lib/active_record/relation.rb:460:in
`method_missing''
2007 Jun 18
2
extending Array class with a method
Hi,
Let''s say I have an ActiveRecord::Base class and I want to be able to
call a method on an Array of these items. For instance, perhaps
there''s a class called Country and another called business, and I''d
like to be able to do something like
great_white_north = Country.find_by_name(''Canada'')
canuck_enterprises = great_white_north.businesses
2006 Aug 14
4
Controller method problem
Hi,
I have a def in my controller see below where i want to find the page
object based on a parameter value and then use the page_id to then find
all the contents that belong to that page in the same method.
Controller
def aboutus
@page = Page.find_by_name(params[''About Us''])
@contents = Content.find(:all,
:conditions => "page_id = #{@page.id}")
end
2007 May 22
3
can I use acts_as_list with a has_many :through association
I''d like to be able to use a has_many :through association and treat
the associations as a list but I''m getting this error when I try an
use an acts_as_list method:
NoMethodError: undefined method `move_to_bottom''
I''m using edge rails r6786.
Here are my domain rules:
Activities are things students can do.
Units consists of a sequenced list of
2005 May 07
4
string syntactic sugar in R? - long post
Currently in R, constructing a string containing
values of variables is done using 'paste' and can be
an error-prone and traumatic experience. For example,
when constructing a db query we have to write,
paste("SELECT " value " FROM table where
date ='",cdate,"'")
we are getting null result from it, because without
(forgotten...)
2007 Jun 29
0
Continuous_builder question...PLEASE HELP!!!
Hi,
I am trying to build a simple (at least that is what I thought after
reading Rails Recipes # 46) continuous integration process into my
subversion source repository.
I am working on windows by the way. I can get the post-commit hook to
execute the rake command in the correct build directory when I do a
commit from my working directory. But the problem is I am getting a:
"system cannot