Displaying 20 results from an estimated 800 matches similar to: "Rails 3: finding a record by name in multilingual app"
2009 Mar 28
10
Use fixtures within fixtures?
Heya,
I''m using globalize2 and have following problem with my fixtures:
categories.yml:
one:
parent_id: two
color: #ff00aa
two:
color: #00ff11
three:
parent_id: two
color: #ab00ab
category_translations.yml
one-en:
id: one
locale: en
name: Cars
one-es:
id: one
locale: es
name: Coches
two-en:
id: two
locale: en
name: Start
two-es:
id: two
locale: es
2012 Oct 19
1
Globalize3 gem, upload data from CSV
Rails 3.1.3
Globalize3 latest
I am not sure if I can ask this question here in general Rails forum.
But I''ll try.
Currently I am using a gem, Globalize3, which is useful for model I18n.
https://github.com/svenfuchs/globalize3
Say, I have a model City, having only one column, name.
City names appear differently depending on the language, so perhaps this
particular gem is useful.
2004 May 05
7
* & ISDN-BRI-PTP & DID & ISDN4Linux does not show incoming number
Hi,
I am using Asterisk on a DSS1 ISDN-BRI with ISDN4Linux (and a Fritz Card PnP).
The ISDN-BRI is in PTP-Mode (Point to Point "german: Anlagenanschluss")
which is enabled within I4L with "hisaxctrl fcpcipnp0 7 1".
Everything works fine except that I can not see the called number/MSN
of incoming calls within Asterisk and because of this I can not route
incoming calls
1999 Apr 15
2
Excel 'save as HTML' problem with Samba 2.0
Hello,
Eversince I upgraded Samba to 2.0 version I've gotten so many calls from
the users regarding Excel 'save as HTML' problem.
What seems to be happening is that the users cannot save their Excel
spreadsheet as html file when they were able to with the previous Samba
version we had installed (Samba 1.9.18p10).
According to MS 'knowledge database', this is a known MS Excel
2009 Sep 04
12
Changing cursor while waiting for remote function response?
Hello,
Google and the search function didn''t help me this time. Is it possible
to change the mouse cursor while waiting for a response of a remote
function call?
--
Posted via http://www.ruby-forum.com/.
2009 Mar 25
6
Hash with key and value from ActiveRecord?
Heya,
I think I have thinking barrier. I just want a simple hash out of an
ActiveRecord.
@attributes = Attribute.find_all_by_character_id(@character).hash {
|u| [u.name, u.value] }
and I would like to access it like
@attributes[:health]
but it doesn''t work. Anyone can help me out with that?
--
Posted via http://www.ruby-forum.com/.
2010 Sep 13
10
Could not find [GEM] locally or in a repository
Hey Guys,
How could I fix the following:
"gem install --no-rdoc --no-ri kete-feedzirra"
ERROR: could not find gem kete-feedzirra locally or in a repository
"gem install --no-rdoc --no-ri libxml-ruby"
ERROR: could not find gem libxml-ruby locally or in a repository
"gem install --no-rdoc --no-ri http_url_validation_improved"
ERROR: could not find gem
2006 Jul 02
5
Pretty URLs -> Routes
Hi
I am having issues with getting my pretty urls to work.
routes.rb:
map.connect '':user'' , :controller => ''front'' ,
:action => ''list'' ,
:filter => ''user''
front_controller.rb:
def list
@advert_pages, @adverts = paginate :adverts, :per_page => 10
@user =
2008 Jul 08
3
undefined method `name' ...........
Hi Community....
I''m new in this game, so this might be a easy question, but I have
done my google, without result, so I will try this....
I''m learning ROR, and I''m using Patrick Lens ''Ruby on Rails'' book.
(This is written for ror 1.x - and I''m using NetBeans 6.1 - ror 2.x -
this might be the problem...)
But...
I have made this
2006 Jul 17
10
getting the user name
Hi I am new to ruby and trying to obtain the user name in the login
index.rhtml where I could display "You have logged in [user name]"
How could I do this? I have been trying different options after reading
the ruby manual but still throw an error.
please help
--
Posted via http://www.ruby-forum.com/.
2010 Aug 22
7
Rails 3: Error saving an object with no useful information
Hey,
I''m kinda desperate cause I''m getting an error and have no idea how to
fix this since it doesn''t give me any information hinting where the
problem is:
irb(main):054:0> reload!;User.last.save!
Reloading...
NameError: undefined local variable or method `to_ary'' for
#<User:0x4ed5d20>
from
2010 Jan 30
12
Best way to connect various applications?
Good evening,
I''ve got three different self-programmed Rails application I need to
connect and manage with a 4th "supervisor" application.
There''s a wiki application, there''s a shop application and there''s a
business directory application all with seperate user database etc.
What I want now is one single user table so it can be all controlled by
one
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 May 29
4
Prompting user to enter value to feed Find
Hi,
While viewing part of a long list of records, the user may want to do a
Find of a specific record (for example, find_by_name). The found record
is then displayed using the list view. I''ve searched the wiki and
couldn''t find a sample or information that will help directly in
implementing this function. Any pointers?
Thanks!
gk
--
Posted via http://www.ruby-forum.com/.
2006 Apr 22
3
how do I manually throw a 404?
I''m sure this has been asked before but a quick search on the web didn''t
give me any hints..
I''d like to do this:
@person = Person.find_by_name
throw_page_not_found unless @person
Anybody know how to do this, do I have to manually tinker with the
response object?
--
Posted via http://www.ruby-forum.com/.
2006 Mar 02
3
Modifying "Find" to always add a condition?
I''d like to always add a condition to any version of "find" (e.g.
Thing.find(), Thing.find_by_name(), Thing.find_by_whatever) so that in
addition to whatever conditions are set, an additional condition is set
:conditions=>"user_id=#{current_user.id}"
I''d like to make sure that a user only sees/edits/creates entries in the
database that have the user_id
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
2005 Oct 07
1
Troubleshooting with "gpd" (Fit generalized pareto model)
Up to now, I have recognized problems with "gpd(..)", the function from
the package "evir"
I think that all these functions that estimate the parameters xi, beta for
the GPD
by given threshold mu use the function "optim(..)" ( gpd, fitgpd, ...)
"Error" example:
data1 <- rgpd(1000, xi= -1.5, mu=1000, beta=100)
so the created poinnts take place in about
2006 Nov 08
3
How to implement status codes in DB and Rails
This is more of a design issue I''m wrestling with, and was wondering
what other people are doing.
I have a products table with status values of In Stock, Out of Stork or
Discontinued. This is unlikely to change any time soon.
Approach A, is to have thses actual values in the status column, at
least the meaning is very apparent, yet querying for products with a
specific status could
2011 Sep 07
6
FactoryGirl doesnt produce unique names?!
Hey,
I got following very simple test case:
require ''spec_helper''
describe Country do
it "should create a new instance given valid attributes" do
Factory(:country)
end
end
Factory looks like:
Factory.sequence :country_name do |n|
"Country #{n}"
end
Factory.define :country do |c|
c.name Factory.next(:country_name)
c.nationality "Foo