Displaying 20 results from an estimated 300 matches similar to: "Problem regarding accessing attributes from object..."
2006 Jul 31
1
How to get result of following SQL Query in Ruby?
Hi,
I have 2 tables as follows:-
_________________ ________________ ____________
taggings | |stores | | tags |
-----------------| |---------------| |------------|
--tag_id | |--store_id | |tag_id |
--store_id | |--store_name | |tag_name |
--user_id | |---------------| |------------|
-----------------|
Now I want to execute
2006 Mar 14
3
Can anybody tell me step by step how validate data on form?
Hi,
I am new to ROR. I have created a form with foru fields in ROR. Now its
working fine for all CRUD operations. But I want to validate data on
form for "validates_presence_of" validation. How to do this?
I tried it by putting line "validates_presence_of :description" . But
its not working. Its throws error like "undefined method `each'' for
2006 Jun 06
4
pls help me regarding Maths round up function.....
Hi,
I have some values on my webpage displaying like
1.22333333333
2.33333344444
2.33377777777
etc.
Here I want to display values upto 2 decimal places correct.
i.e, 1.22333333333 should be dislayed as 1.22
2.33333344444 should be dislayed as 2.33
2.33777777777 should be dislayed as 2.34
& so on....
How to do this in ruby?????
Is there any function???
Thanx in advance.
Prash
--
2006 May 08
4
How to disable textbox in Ruby?
Hi,
I want to disable textbox in my page so that user can not modify its
contents. How can we do that in ruby?
Thanx,
Prash
--
Posted via http://www.ruby-forum.com/.
2006 Mar 13
4
undefined method `validates_presence_of'' for #<ProductsContr
Hi,
I am trying to use method `validates_presence_of'' for validating my
input fields on form . I m using it in my action class as follows:-
=======================
validates_presence_of(params[:product][:quantity])
======================
But when I am running my application i m getting error like:-
=========================
undefined method `validates_presence_of'' for
2006 Apr 25
2
undefined method `to_url'' for "This is my weblog":String
Hi,
In my application I cant use "to_url" method on any of strings. What
should I do if i want to use this method? Is there any plugin needed to
download for this "to_url". In my application now when I am trying to
use this methos I am getting following error:-
========================================
undefined method `to_url'' for "This is my
2006 Jun 09
2
How to mail decrypted password to user?
Hi,
I am using acts_as_athenticated plugin for my rails application. That
plugin is using "SHA1" algorithm to encrypt password & stroe it into
database. Now in future suppose user requsted his password through
email, hhow should I decrypt that password in my application & for
sending it through mail?
Please help me.
I am trying this since last 2 days. But still not
2006 May 08
7
How to get difference between two dates in days???
Hi,
I want to calculate difference between Current date & previous date
(stored in database). The difference should be in days. Hhow to do
that??
PLs tell me.
Thanx in advance.
Prash
--
Posted via http://www.ruby-forum.com/.
2006 Mar 17
3
How to check for presence of particular value entered ?
Hi,
I am entering value in textbox ("name") on form. Now name field in
database is having ''unique'' constraint on it so that no 2 records with
same name allowed in database. Now when I m trying to enter same name
into database from my form I m getting following error.
================================
Mysql::Error: #23000Duplicate entry ''Prashant''
2015 Nov 29
1
How to delete "proxy" attribute in passdb lookup?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Am 29.11.2015 um 01:01 schrieb Timo Sirainen:
Hi Timo,
> Not right now, because any value at all is treated as "true" (and
> I'm pretty sure even empty value). I suppose the best solution
> would be to finally change all the passdb/userdb/plugin boolean
> values to actually support "no" value as not being
2006 May 07
6
Challenging SQL for you...
Gents,
My heads been out of the sql game for too long (or it''s simply too early).
I''m trying to extend the acts_as_taggable plugin (note: not gem) so that
you can specify a list of tags you''re interested in, and the plugin will
return only those items that are tagged with *all* these tags.
The plugin uses primarily two tables: tags, to keep all the various tag
2007 Jul 19
2
Subsetting dataframes
Dear all!
W2k, R 2.5.1
I am working with an ongoing malting barley variety evaluation within
Sweden. The structure is 25 cultivars tested each year at four sites, in
field trials with three replicates and 'lattice' structure (the replicates
are divided into five sub blocks in a structured way). As we are normally
keeping around 15 varieties from each year to the next, and take in 10 new
2007 Jun 07
4
checking associated objects have been deleted
I have the following model:
class Book < ActiveRecord::Base
has_many :taggings, :dependent => :delete_all
has_many :tags, :through => :taggings
end
is it possible to check that associated taggings are being destroyed
using mocks? I don''t want to test that rails is deleting the
associations, I want to test that I have specified the association as
a dependent one.
the only
2006 Jul 04
2
has_many working correctly only on reload!
I have this code that is using svn externals with rails EDGE working
fine for the past couple of months. A couple of days ago, this code
died. Even after deleting vendor/rails, this code doesnt work:
class Tag < ActiveRecord::Base
has_many :taggings
has_many :events, :through => :taggings
has_many :users, :through => :taggings
end
class User < ActiveRecord::Base
# Virtual
2006 May 08
3
How to get count of records from database?
Hi,
I want to display count of all records with particular field value from
database onto my view. How should I do that?
PLs tell me.
Thanx.
Prash
--
Posted via http://www.ruby-forum.com/.
2006 May 19
1
How to upload text files or csv files in ruby??
Hi,
I want to upload text file & csv file to server through my rails
application. How to do that?
PLease tell me if any plugin available for that? If not then how to
upload files??
Thanx in advance.
Prash
--
Posted via http://www.ruby-forum.com/.
2006 Mar 10
2
Syntax for <input type=hidden> in rhtml????
Hi,
I am new to ROR. PLease tell me what is syntax of creating hidden field
in form inside RHTML file. I knonw the syntax for text box (<%=
text_field ''product_item'',''product_id'', :value=>product.id%>)
But I don''t know syntax for hidden field(like <input type=hidden> in
HTML).
Please tell me.
Thanx in advance.
Prash
--
Posted via
2006 Mar 17
2
How to specify default action for particulr actioncontroller
HI,
How to specify default action for particular actioncontroller? Currently
when I m typing the URL as "http:\\localhost:3000\actioncontroller_name"
, then I m getting the default actin page as list.rHtml. But instead I
want my action page to be index.rHtml.
How to do it?
Thanx.
Prash
--
Posted via http://www.ruby-forum.com/.
2006 Mar 22
1
How to retrieve attribute values of objects?????
Hi,
I am writing following line in my code:-
=================
@product1=Product.find(:all, :conditions => ["id = ? ",
params[:product][''product_id''+count.to_s]])
print @product1.inspect
===========================
So I am getting on console following output.
==========================
[#<Product:0x3cd61c8 @attributes={"demand"=>nil,
2006 Mar 24
2
How to use Readymade plugins?????
Hi,
I have downloaded "Ruby on Rails validator plugin for password fields".
& they have specified that for using it we have to unzip it in plugins
directory of your rails application. But I cant find the plugin
directory in my Rails Application. Also there is plugin directory in
Rails server installation directory:-"C:\local\ruby\freeride\plugins\".
& so I have