Displaying 20 results from an estimated 1000 matches similar to: "weird result for a custom attr reader!"
2006 Jun 01
4
how to: update a select from another select
Hi all,
I woke up at 4AM this morning to find a solution for this and it is
still not working.. grrr! lost sleep for nothing!
Anyways, I have 2 select list and I want the content of the second list
to be updated according to what is selected in the first list.
I did this in the past by having my application generate all the
possible content of the second list and make some Javascript to do
2006 May 29
8
Rails and user authentification
I am a the point now where I have to add user authentification to my
application.
Anyone can point me toward an easy to use / secure library? I know about
ActiveRBAC and was wondering if there is anything else that I should
consider.
Thanks!
--
Posted via http://www.ruby-forum.com/.
2006 Jun 08
7
How to make an OSX Finder in rails/AJAX?
I need to make a category browser that would allow nested categories. Is
there any receipe on that?
Currently, I use the :onchange event from one of the form element to
update the first select (out of 4-5 selects), but I dont know how to
elegantly reset all the child selects if I change the value from the
first.
All the categories are fetched from the DB and I would like a
2006 Apr 16
5
render :collection and default value
Hi all,
I am having a lot of trouble to get the default value of text fields
when they are generated by a partial from a collection.
I have been on this for a whole week and I didnt find a single exemple
on the internet of someone using a partial that generate text field with
a default value.
I cant believe that I am the only one having this problem. Anyone has an
exemple they can show me?
2006 May 06
6
assert_raises --> how does it work?
Hi,
I have this code fragment:
def test_delete_concept
assert_not_nil Concept.find(concepts(:entreprise).id)
get :delete_concept, {:concept_id => concepts(:entreprise).id}
assert_raises :RecordNotFound,
Concept.find(concepts(:entreprise).id)
end
basicaly, on the first line, I make sure that the concept exist in the
DB. On the second line I delete the concept fron the DB.
2011 Feb 17
1
Select distinict on not chainable with order method
Hi.
I would like to do code refactoring:
@beers = []
Beer.all.each do |beer|
unless @beers.find{|c| c.brand_id == beer.brand_id}
@beers << beer
end
break if @beers.size > 29
end
So I achieved this by writing scope (on PostgreSQL):
scope :with_unique_brand, select("DISTINCT ON (beers.brand_id)
beers.*")
Using this scope alone is working
2005 Dec 29
7
belongs_to causing NoMethodError exceptions ... ?
I''ve got a really strange problem using belongs_to. I apologize in
advance for the length... this is going to take a while to explain.
Basic idea: Creating a User requires that the user enter an email
address and activation key that matches an existing PendingUser.
After creating the user successfully, that pending user should be
marked as "used".
The problem:
When I
2008 Jul 22
2
ActiveRecord Associations issue
Hello all and thank you for reading this message.
I am new to RoR, and ruby too, but i am quite excited about it.
I am developing a RoR project and with active record associations in
the following
manner
# Tables (all tables have only one record)
CREATE TABLE `webcars_development`.`cars` (
`id` int(11) NOT NULL auto_increment,
`model_id` int(11) NOT NULL default ''0'',
2004 Apr 28
9
chan_sip.c max number of retries?
Still getting the same error.
Apr 29 11:57:49 WARNING[1125329600]: chan_sip.c:503 retrans_pkt: Maximum retries exceeded on call 6b8b4567327b23c6643c986966334873@211.28.255.135 for seqno 102 (Critical Request)
please advise anyone!!!!!someone!!!
jai
2012 Mar 28
1
collection_select
_form.html.haml
= f.label :Select_Brand, "Select_Brand<em>*</em>".html_safe
= collection_select(:brand_name, :brand_id, Brand.all, :id, :name,
:prompt => "Select a Brand" )
show.html.haml file
%table
%tr
%td
Brand_Name :
%td
= @message.brand_id
After writing this code I am not able to see the brand name. Its not
giving any error but
2009 Jun 02
9
XML::LibXML::Reader
is there anybody who knows how we can get child values using libxml
(Reader class)
def xml_import_to_brands
require''xml''
reader = XML::Reader.file(''c:/brands.xml'')
.
.
.
2006 Jun 30
0
Interpolation in association conditions broken; broken backwards-compatibility?
I believe it used to be possible to interpolate values into
associations'' conditions with single quotes, but it isn''t anymore.
has_many :widgets, :conditions => ''brand_id = #{brand_id}''
Anyone else remember that? It seems to have been snuffed out in
changeset 3897 with the removal of interpolate_sql(@conditions)
Was the change (and the fact that it
2010 Jun 17
1
Problem with options_for_select
Hi,
I have a problem with the form select. In the value field I have the
generated html...
<%= f.select :brand_id,
options_for_select([[''Brands'', 0]] +
@search_brands.map { |b| [b.name, b.id]}),
{:id => ''cbxBrand'', :tabindex => (@tabindex += 1)} %>
This is the html:
<select name="search[brand_id]"
2006 Feb 15
3
Like Query Across Multiple Tables
Firstly, I''m still learning Ruby and rails, so there could be a very
simple solution to this.
I want to search across multiple tables with a "like" query eg: (SQL is
probably the easiest way to describe it):
select
products.*
from products
inner join brands on products.brand_id = brands.id
where
products.name like ''%canon%''
or brands.name like
2006 Nov 15
1
PAM authentication to Active Directory
Hello list,
I want to authenticate (only authenticate) through active directory with PAM. I googled around and everything I found, wheter it is forum posts or howtos, it always talks about winbind and joining the linux machine to the windows domain. I do not which to do this, I only want to get PAM to authenticate with the AD and then everything else is local.
Should I use pam_winbind ?
2007 May 30
2
newb trying to figure out ActiveRecord relationships
3 tables. item, brand, commercial
item
--------
id
name
brand_id
name
brand
---------
id
name
commercial
----------
id
item_id
The idea is that a commercial will have one item.
each item will have brand.
and a brand may have zero to many items.
I can''t figure out how to make the relationships for my models.
Eventually, i''d like to be able to show a brand name from a
2006 May 20
3
Navigation between DB Items with active Record
Hi,
I am having troubles to figure out how to move from one record to the
other without using <find_by_sql> or other ugly tricks. So far, I have
managed to do a lot of stuff without it but I decided that I need to
learn how it works this weekend! So I need your help to figure that
out...
I have the following 4 models:
class Client < ActiveRecord::Base
has_many :client_variations
2006 May 22
6
how HTML_Option works?
Hi all,
all the form helpers can take a serie for options but I cant find any
documentation about them. Any one can point me toward one?
Or at least tell me how I can for example add a function that would be
call with the onblur event from a input box?
Thanks!
--
Posted via http://www.ruby-forum.com/.
2006 Aug 09
1
Migrating a Field to External Model
I have a model Product with an attribute ''brand''. Currently it is a
simple attribute, however, I am migrating it to a separate model
Brand so that I can have other attributes with each brand. I created
the the model and created and ran the migration to create the new
table. So far so good. Then I created a separate migration to
transfer the data. The up method
2006 Jul 15
1
Relationship problem, newbie problem, need help!!
Hey all
I seem to be having some problems with my relationship between a few
tables...
If i then run the following query in mysql, i get the data i want. How
do i do this in rails relationships and models?
select * from shop_addresses
left join shops on shops.id = shop_addresses.shop_id
left join styles on styles.id = shops.style_id
where shop_uri = ''127.0.0.1''
Cheers!!