Hi folks. First post on these forums, after finally giving up on
railsforum.com. I recently installed the relevance fork of rcov and am
having no luck at all.
http://github.com/relevance/rcov/tree/master
[code]
sudo gem install relevance-rcov
[/code]
Easy enough. Everything seems to have
2009/8/26 Ruby on Rails: Talk dazzaroo...@gmail.com:
I have the code which creates the following made up of an array of 3
TreatLists each with a number of Treatlistitems (I've broken it up to
make it easier to read).
? @breakdown
= [
#Treatlist:0x23b98ac @items=[
#Treatlistitem:0x2389ef4
On 8月27日, 上午2时45分, Frederick C. Lee amourinet...@gmail.com wrote:
Here's my environment (Mac OS X 10.5.8):
[/Users/Ric/workarea/rails/demo]ruby --version
ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-darwin9]
[/Users/Ric/workarea/rails/demo]rails --version
Rails 2.3.3
Robert Walker wrote:
Sergio Ruiz wrote:
set :user_sudo, false
Should that not be?:
set :use_sudo, false
correct! thanks so much!
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
On Aug 27, 8:03 am, Colin Law clan...@googlemail.com wrote:
2009/8/26 Ruby on Rails: Talk dazzaroo...@gmail.com:
I really have no idea why this is not working or not returning a zero
value?! Any ideas please?
A bit of a guess here but it may be that fact that this will attempt
to
Hi Everybody,
I'm having 3 tables 1)Insurance 2)policy 3)
Users
and all have has and belongs to many relationships
I want to link all this 3 tables .
Plz guide me on how to link all these table using HABTM
--~--~-~--~~~---~--~~
You received
Modify your path to use /opt/local/bin before /usr/bin
On Aug 27, 5:59 am, binku 006600...@gmail.com wrote:
On 8月27日, 上午2时45分, Frederick C. Lee amourinet...@gmail.com wrote:
Here's my environment (Mac OS X 10.5.8):
[/Users/Ric/workarea/rails/demo]ruby --version
ruby 1.9.1p0 (2009-01-30
For admins and users, I would keep them both in the same table with a
role field to differentiate them. It really depends on your security
requirement and if admins and users login using the same
authentication mechanism. A role table for lookup is required.
For colors, MYSQL allows an ENUM
If it is a class, why are you encapsulating it inside a module? You
should be able to put the class rb file in your lib directory and use
it in your controller. Make sure you name the file right. Again if
you need to namespace it inside a module, just include the module in
your controller
enter just processes the submit button. if you disable the submit
button, then enter key press will be disabled as well. personally, i
would get rid of the submit tag and use a image_submit_tag to get rid
of stupid keyboard annoyances. This will force the user to click on
the link to submit
The API documentation will help with these. Bookmark
http://api.rubyonrails.org
http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#M001739
On Aug 26, 8:50 pm, Dudebot craign...@gmail.com wrote:
Oops, meant to say In my sessions view I have...
On Aug 26, 10:48 am,
Thanks super. I'm still getting used to this framework, which
includes figuring out where and how it's documented :)
On Aug 27, 3:58 am, Mukund marut...@yahoo.com wrote:
The API documentation will help with these.
Bookmarkhttp://api.rubyonrails.org
Thanks for all of the answers.
I solved it a little differently and will explain how in case
a) it helps anybody else
b) there is a flaw in my method which I have overlooked
What I did was in the controller:
Create a model object: @applicant = Applicant.new(params[:applicant])
Wait for a post
Hi
Have you read this?
http://www.globalnerdy.com/2009/08/20/how-and-where-is-_why/
Why this person vanished?Anyone knows? And actually who is he? Why did
he do that? Please share your thoughts
Sijo
--
Posted via http://www.ruby-forum.com/.
How do I make sure item 0 is selected in:
%= select(channelnotes, channelnotes, Channelnote.find
(:all, :order = 'tstamp DESC', :limit =3, :conditions =
[deleted=0]).collect {|p| [ p.note, p.note]}, { :include_blank =
true},{:onKeyDown = fnKeyDownHandler(this, event);, :onKeyUp =
Hi.
In my view I have a line like this:
link_to('Update timestamp', order_path(@order, :update_timestamp = true),
:method = :put
This generates HTML like this
a href=/orders/2131771394?update_timestamp=true onclick=var f =
document.createElement('form'); f.style.display = 'none';
Hi all,
I have been deploying my RoR application on EC2 server and most
frequently i get 500 server internal problem . error .
I figured it out this happens when number of user increase above
10.Could anyone please suggest which server to host is best for RoR ?
As i googled , i got number of
Greg Donald wrote:
On Wed, Aug 26, 2009 at 11:21 AM, Rob
Biedenharnr...@agileconsultingllc.com wrote:
Actually, there's no need to nil the id because you can't mass-assign
the id.
b = B.new(a.attributes)
would have exactly the same effect.
I have 47 models with matching history models
Hi,
I'm interested in automating online banking login checking for new
transactions - what's best approach? (e.g. which gems/libraries etc)
Anyone already built something that does this?
For example login each hour and check for any new credit card
transactions and then email them to myself if
Thanks Robert,
Now open flash is working very fine, but in firefox i want to take
print where i getting only blank page only.
Any Idea... Same way is possible to save this flash report as an
image.
Thanks in Advance
On Aug 25, 8:37 pm, Robert Walker rails-mailing-l...@andreas-s.net
wrote:
E. Litwin wrote:
Well, when I try to view the report, I get one of two behaviors. Ignore
the lack of 'a', it's a bug with the console I use (yay Windows).
To fix that Windows issue with a not showing, follow the
instructions here:
http://codesnippets.joyent.com/posts/show/414
Thanks!
On
There is some issue with sqlite3 on your machine. Is the DLL available
to Ruby?
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post to this
Sijo Kg wrote:
Hi
Have you read this?
http://www.globalnerdy.com/2009/08/20/how-and-where-is-_why/
Why this person vanished?Anyone knows? And actually who is he? Why did
he do that? Please share your thoughts
Sijo
http://www.ruby-forum.com/topic/193761
Colin,
I used the array approach and it worked.
Like this...
@import = Import.find(:all)
@import.each { |i| i.destroy }
Thanks for the input.
John
Colin Law wrote:
2009/8/26 John Mcleod rails-mailing-l...@andreas-s.net:
I have this:
imports_controller:
def process_csv
# First
Hi.
I would like to set @request.env[HTTP_REFERER] in an integration
test, but due to its nature, I would naturally set this value to the
previousle request url. How do I do that.
Thanks.
Jarl
--~--~-~--~~~---~--~~
You received this message because you are
2009/8/26 mgpowers gmichae...@hotmail.com:
no there is no db defined ...I just installed rails and created a
simple rails app but
can get app environment from main web page or hit my controller
properly
Rails assumes that there will be a database unless you explicitly tell
it there is not
Sorry, I still can't understand how to run rails in thread safe mode
under JRuby (one running instance supporting multiple concurrent requests).
If I try to enable config.threadsafe! in
config/environments/production.rb under Glassfish Gem my Rails
application still run single threaded.
Here
Hello
I'm trying to DRY my code and I think It could be done even better. The
following 2 functions are before_save callbacks that practically do the
same thing, but on a different set of attributes.
Since the code is highly similar, I was wondering if someone could help me
to refactor the code?
def normalize(property)
result = normalize_generic(self.send(property))
self.send(#{property}_min=, result[:min])
self.send(#{property}_max=, result[:max])
self.send(#{property}=, result[:display])
end
object.normalize(:size)
object.normalize(:budget)
-
Maurício Linhares
Hi,
try this:
def normalize
update_result(budget)
update_result(size)
end
def update_result(field_name)
result = normalize_generic(self.send(field_name))
eval(self.#{field_name}_min = result[:min])
eval(self.#{field_name}_max = result[:max])
Adding the 65536 flag seems to allow me to gather a resultset from the
stored procedure, yet my commands go out of sync. Running any query
(even a simple Model.first) after running a Stored Proc that returns
results gives this error:
ActiveRecord::StatementInvalid: Mysql::Error: Commands out
Hi Folks,
I'm looking for an elegant Ruby one-liner...
I have a set of records in my database that I want to check to see if
the :description field is identical.
And, because it's Thursday morning (where I live), I would like to do
it as elegantly and as one-line-er-ly as I can
Something
On 27 Aug 2009, at 15:09, Patrick Doyle wrote:
Hi Folks,
I'm looking for an elegant Ruby one-liner...
I have a set of records in my database that I want to check to see if
the :description field is identical.
And, because it's Thursday morning (where I live), I would like to do
it as
Thank you both for your feedback. Based on your suggestions, I've finally
decided to implement it in the following way:
%w[size budget].each do |property|
define_method(normalize_#{property}_range) do |*args|
result = normalize_generic_range(self.send(property))
you can do it like this:
@headers ||= {}
@headers[HTTP_REFERER] = previous_link_url
get/put/post some_link_url, nil, @headers
hope this would help you.
thanks.
On Thu, Aug 27, 2009 at 8:02 PM, Jarl Friis j...@gavia.dk wrote:
Hi.
I would like to set @request.env[HTTP_REFERER] in an
My users provide some description ( TEXT field) and I would like to
generate tags automatically from them?
are there any plugins available?. Any directions would be appreciated.
cheers
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received
Wouldn't it just be controller_additional_function_path?
You can check by running rake routes
On Aug 26, 11:08 pm, Dhruva Sagar dhruva.sa...@gmail.com wrote:
Hi Everyone,
I am developing a small web application using rails, in my controller I have
added a function which is apart from the
On Wed, 2009-08-26 at 19:12 +0200, Braulio Lima wrote:
bill walton wrote:
Hi Braulio,
On Wed, 2009-08-26 at 13:14 +0200, Braulio Lima wrote:
Hi All,
Anyone know of any component or plugin like Goldberg?
Are you asking about an alternative to this?
Good to hear that you've solved the problem yourself.
Is now too late to point out that you could probably use
validates_uniqueness_of in your model?
http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#M002167
--
Posted via http://www.ruby-forum.com/.
Here's a better solution:
%w[size budget].each do |property|
class_eval %Q!
def normalize_#{property}_range
result = normalize_generic_range( self.#{property} )
self.#{property}_min = result[:min]
self.#{property}_max = result[:max]
I have a similar problem that I'm working on, but I was going to take
a slightly different approach.
My problem is that I'm collecting completely anonymous data at first,
but then I want people to be able to come in later and create an
account, then hopefully be able to find their records. I'm
If you dont want duplicate data then just add the following to the
model. Thats where validation should be.
validates_uniqueness_of :email_address
On Aug 27, 8:43 am, Matt W. m...@squid37.com wrote:
I have a similar problem that I'm working on, but I was going to take
a slightly different
Looks like acts_as_taggable_on is what you need. The example included
on that page should make it pretty easy to do.
http://github.com/mbleigh/acts-as-taggable-on/tree/master
On Aug 27, 8:21 am, Rails List rails-mailing-l...@andreas-s.net
wrote:
My users provide some description ( TEXT
Hi,
im a rails newbie, so please be gentle:
let's say category habtm products and i've got a product with the id
7.
when i use the url
/categories/7/products
should the server show me only the categories of product 7?
On my Server it always shows all categories i have.
How do i solve this
On Aug 26, 11:32 pm, Tom Dunn rails-mailing-l...@andreas-s.net
wrote:
On my site, I am having a sort of slideshow in which people can purchase
the ability to put a picture on. It's sort of a one shot deal thing, in
which someone can go on and navigate to a page that allows them to pick
a
On Aug 27, 2009, at 8:54 AM, hansfh wrote:
Hi,
im a rails newbie, so please be gentle:
let's say category habtm products and i've got a product with the id
7.
when i use the url
/categories/7/products
should the server show me only the categories of product 7?
On my Server it always
Thanks for the replies.
I'm also not sure if doing the validation in the model would work.
Assuming that the user has a slow connection and hits submit on the form
twice, then the first time the email would be unique, so everything
would be good. However, would it not be the case that the
And maybe one more.. Again, I know you dislike javascript, but.. :)
This isn't exactly generic - I'm pulling it straight out of something
I'm doing right now. Why not show a spinner (and disable the submit
button?) when they press submit and hide the spinner when that's done ?
It's all about
After talking to some friends of mine, the IP address is NOT a good
idea...looks like I'll be looking at a cookie solution instead.
On Aug 27, 7:43 am, Matt W. m...@squid37.com wrote:
I have a similar problem that I'm working on, but I was going to take
a slightly different approach.
My
That's a cool idea.
I will also have a play around with that this evening.
Thank you very much.
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
2009/8/27 hansfh i...@strassenfeger.tv:
Hi,
im a rails newbie, so please be gentle:
let's say category habtm products and i've got a product with the id
7.
when i use the url
/categories/7/products
should the server show me only the categories of product 7?
On my Server it always
You missed posting the source...
Lets have a look at edit and show views
On Aug 27, 11:58 am, techtimer frmont...@hotmail.com wrote:
I added a new column using a migration. Once I updated the
new.html.erb, edit.html.erb, show.html.erb, and the index.html.erb I
brought up my web pages. There
I have created original method and trying to pass newly instantiated
object to ERB file, but encountering NoMethodError in ERB file with the
following error message.
---
NoMethodError in Products#lookup
Showing
Hello all...
I am on Chapter 4 of RailsSpace and I have hit a problem when it comes
to linking in the document.
To start with in an earlier chapter I created a page called site.rhtml
which used these attributes:
%= link_to_unless_current Home, :action= index %
|
%=
I have a set of javascript functions that are reading json data
periodically to create innerHTML in a view.
Within that innerHTML, I need to put form(s) based on the structure
and content of a row in a table. I am thinking I will just have to
somehow hard-code this in html. Perhaps there is a
Mauricio,
Thank you again for your help. Is there any difference between your solution
and mine?
Kind regards,
Axinte
2009/8/27 Maurício Linhares linhares.mauri...@gmail.com
Here's a better solution:
-
Maurício Linhares
http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr
Hello,
I'm trying to validate 2 dates that were provided by the user using a form
that wraps a model.
I want to do the following 2 validations in the model:
validate the date format = That I know how to do!
if the format validation was a success, then ensure that date1 is
smaller or
On Aug 27, 7:26 am, Jarl Friis j...@gavia.dk wrote:
Hi.
In my view I have a line like this:
link_to('Update timestamp', order_path(@order, :update_timestamp = true),
:method = :put
This generates HTML like this
a href=/orders/2131771394?update_timestamp=true onclick=var f =
I'm thinking that for some reason Rails isn't seeing a content_type so
is falling back to .erb rather than using .html.erb, but I can't
figure out how this would happen or why it's not able to find the
correct file. I encountered this when changing this view from %=
render @gigs %, which finds
I am creating a web app with ruby on rails.
I have a user account database and looking for any plugin that i can use
to do standard admin tasks like.
1. scrubbing the database to look for expiring accounts and send
notifications.
2. generate newly added users per day etc.
Any plugin that can do
Judging by the exception's location, the test environment config is
not getting loaded. Do I need to do something else to activate this
environment?
341 case abcs[test][adapter]
342when mysql
343 ActiveRecord::Base.establish_connection(:test)
344
records.map(:description).all?(:==)
nice... I was trying to figure out something with #inject/#sum, but
that looks great.
--wpd
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post
hi,
i want to implemnt a system for display recurrent events,
i startly with a embrional code:
# on my DB i have 1 record:
{ :title = example, :repeat_day = 4 }
# on my controller:
@repetitions = Recurrent.find(:all)
# on my view:
@new_object = []
start_date =
On Aug 27, 5:32 pm, Ryoichiro Kamiya rails-mailing-l...@andreas-
s.net wrote:
When viewing @product variable by running this flow in Aptana debug mode
and stop it at erb source code, @product seems to have information and
not nil (See attached). I was trying to copy standard rails
The user controller needs to have the register action. Also run
rake:routes to make sure you've got wired correctly.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post to this group,
I added a new column using a migration. Once I updated the
new.html.erb, edit.html.erb, show.html.erb, and the index.html.erb I
brought up my web pages. There was a field to update show. I tried the
update and the it was successful but the update did not show up in any
of the other pages. What
This is mostly about Apache (or equivalent) settings higher up
than .htaccess - look around for documents regarding name-based
virtual hosting. It's quite possible to set up - pretty much every
shared webhost out there is doing it.
--Matt Jones
On Aug 26, 2:58 am, Abhishek shukla
Yes, you're defining and method and using send at every call, my
solution will generate a method with direct calls instead of sending
them.
-
Maurício Linhares
http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr
On Thu, Aug 27, 2009 at 5:24 PM, Axinte Logoal...@evo-green.fr wrote:
2009/8/27 RubyonRails_newbie craigwest...@googlemail.com:
Hello all...
I am on Chapter 4 of RailsSpace and I have hit a problem when it comes
to linking in the document.
To start with in an earlier chapter I created a page called site.rhtml
which used these attributes:
%=
OK sounds good.
So, I imagine one will have to port the data over to the new server.
It just seems like there might be some loss of data if the time takes
too long between swithcing. i guess we cross the bridge when it
comes.
On Aug 26, 5:23 pm, John Yerhot joyer...@gmail.com wrote:
I wouldn't
The table I am working with is contacts. The new column is type. I
changed the edit.html.erb source by adding.
p
%= f.label :type %br /
%= f.text_field :type %
/p
In the show.html.erb I added
p
bType:/b
%=h @contact.type %.
/p
What else do I need to post the source...
On Aug 27,
Sorry, I didn't understand what you meant by post your code. I
snapped, finally. Here it is. Thanks for your help.
Again the table is contacts and the field I added is type.
edt.html.erb
h1Editing contact/h1
% form_for(@contact) do |f| %
%= f.error_messages %
p
%= f.label :user_id %br
The problem is that your users, like most users, are not very bright.
They double-click (or in this case, triple-click) submit
buttons. :disable_with will pretty much solve the issue; anybody with
enough savvy to have JS disabled likely knows that you don't double-
click submit buttons.
--Matt
Kyle F wrote:
Looks like acts_as_taggable_on is what you need. The example included
on that page should make it pretty easy to do.
http://github.com/mbleigh/acts-as-taggable-on/tree/master
On Aug 27, 8:21�am, Rails List rails-mailing-l...@andreas-s.net
Thanks Kyle, unfortunately there
Do you know how that is achieved?
I was assuming the page (application.rhtml) is used as the template
for the whole site, so wasn't expecting to have to configure the links
throughout the site.
I'm new to this, so it's probably easy - but i'm maybe looking at it
from the wrong angle.
So - if
Hi,
I am trying to achieve the following.. wondering if there is any way to
achieve this..
Some background:
1. i have an application where the user can request an specific email to
be sent at a scheduled time. For e.g. lets say user A wants is
scheudling the email to be sent for 12:00pm. This
Hi,
I installed acts-as-taggable-on plugin and generated
acts_as_taggable_on_migration (Mac OS X, Rails 2.3.3, MySQL).
The migration generated has
t.column :taggable_id, :integer
t.column :tagger_id, :integer
MySQL complains when rails tries create
FOREIGN KEY (taggable_id) REFERENCES taggables
cheers for the notes..
I found it eventually.
Updated to:
%= link_to_unless_current Home, :action = index,
:controller = site % |
this seems to work now... (phew!)
cheers
On 27 Aug, 22:25, JL Smith autige...@gmail.com wrote:
Oh, and the links you posted in the first post don't specify a
The foo you Foo'ed is not the foo you think you Foo'ed...
In other words, you'll have to show the Bar code that created that
pseudo-Foo before we can help.
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are
2009/8/27 Axinte Logo al...@evo-green.fr:
Hello,
I'm trying to validate 2 dates that were provided by the user using a form
that wraps a model.
I want to do the following 2 validations in the model:
validate the date format = That I know how to do!
if the format validation was a
If you are interested in using emacs with Rails and Ruby, it's
probably worth looking at Rinari, too:
http://rinari.rubyforge.org/
Also, check out the various emacs-starter-kits and dotfiles on github:
http://github.com/search?q=emacs-starter-kitstype=Everythingrepo=langOverride=start_value=1
Why not convert each date to Ruby Time objects and compare those?
--wpd
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post to this group, send email to
Oh, and the links you posted in the first post don't specify a
controller so it assumes those actions all belong to the current
controller which obviously is not the case...so you need to add the
site controller to the links:
%= link_to_unless_current Help, :controller = 'site', :action =
'help'
Hi guys,
I have a problem retrieving data in JSON format using Ajax with
JQuery.
Here's the code I use:
/app/controllers/stories_controller.rb:
def index
@stories = Story.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml = @stories }
I think the problem is with the name of the column, :type. It's a
reserved. I read there is a way to use it, but I say it's really not
worth it. Try dropping the column and adding it with different name.
Should work.
On Aug 27, 11:16 pm, techtimer frmont...@hotmail.com wrote:
The table I am
Thank you. I removed type and created a new field. Everything is
working great thanks for your help.
On Aug 27, 4:33 pm, Bashar bashar.abdul...@gmail.com wrote:
I think the problem is with the name of the column, :type. It's a
reserved. I read there is a way to use it, but I say it's really
2009/8/28 Rails List rails-mailing-l...@andreas-s.net:
Kyle F wrote:
Looks like acts_as_taggable_on is what you need. The example included
on that page should make it pretty easy to do.
http://github.com/mbleigh/acts-as-taggable-on/tree/master
On Aug 27, 8:21�am, Rails List
Matt Harrison wrote:
I have no idea if this is the best method by any means, but I have used
it before with no problems:
I created a model called AppConfig which had an id, a key and a value. I
could set the key to the name of the configuration (such as
allow_new_signups) and then set
Man I know this is in the wrong forum, so first let me apologize.
However, I can't figure out why I am unable to post in the JRuby
google group. I have tried on two separate occasions (12 hours apart)
and it's now approaching 12 hours since my last attempt. What am I
doing wrong? I think
89 matches
Mail list logo