[Rails] why story.votes return Array, but story.votes.create works?

2010-05-23 Thread Jian Lin
In Ruby on Rails, say a Story object can has_many Vote objects (a story is voted hot by many users). So when we do a s = Story.find(:first) s is a Story object, and say s.votes returns [] and s.votes.class returns Array So clearly, s.votes is an empty Array object. At this

[Rails] What does attachment_fu do when saving?

2010-05-23 Thread Sam Kong
Hi, I have a model with attachment_fu. The model saves images but I didn't put validates_as_attachment. I understand that it takes long time to create an object as it has to process images. But I don't understand why it takes long time to update the object (not changing file but only modify

[Rails] remote_function return No action responded error

2010-05-23 Thread nirosh
here i given my codes when i execute this remote_function rails give me this error ActionController::UnknownAction (No action responded to report_poem. Actions: create, destroy, edit, index, new, show, update): in my view span class=report_button onclick=

[Rails] Re: why story.votes return Array, but story.votes.create works?

2010-05-23 Thread Frederick Cheung
On May 23, 7:10 am, Jian Lin li...@ruby-forum.com wrote: So clearly, s.votes is an empty Array object. Actually it's not. It's an AssociationProxy object pretending to be an instance of Array Fred At this time, when     s.votes.create is called, it actually invokes a method of the

[Rails] Re: Extending a module in a controller

2010-05-23 Thread Frederick Cheung
On May 23, 12:59 am, Marnen Laibow-Koser li...@ruby-forum.com wrote: module Enumerable   def my_compress     ... but when I visit the web page in question I get No method 'my_compress' for Array ... I'm probably doing something fundamentally wrong - what could/should I be

[Rails] Re: why story.votes return Array, but story.votes.create works?

2010-05-23 Thread Jian Lin
Frederick Cheung wrote: On May 23, 7:10�am, Jian Lin li...@ruby-forum.com wrote: So clearly, s.votes is an empty Array object. Actually it's not. It's an AssociationProxy object pretending to be an instance of Array Fred not like this? irb(main):010:0 class Foo irb(main):011:1 def

[Rails] validating a form with a foreign key

2010-05-23 Thread Peter Vilagi
Hi there. I have a problem with validating a form, where is foreign key present. I have a table like this: id name password status_id This is the way that status_id is implemented to the users table. td%= select_tag ('status_id', options_for_select([['-- choose one --', nil]] +

[Rails] Re: Extending a module in a controller

2010-05-23 Thread Toby Rodwell
Frederick Cheung wrote: On May 23, 12:59�am, Marnen Laibow-Koser li...@ruby-forum.com wrote: ... by putting it inside the controller like that you've created a new module called LookupController::Enumerable rather than extending Enumerable. If I were you I'd keep extensions to core classes

[Rails] [Rails 3] Trouble with named routes and form_for

2010-05-23 Thread Michael Jurewitz
Hi guys, I'm having trouble getting named routes and form_for to play nicely in quite the way I would expect. Here's a quick summary of what I've got going on: Named route: resources :thread, :class_name = forum_thread Controller name: forum_thread_controller Model object:

[Rails] Introducing ResourceAwareness

2010-05-23 Thread Ingo Weiss
Hi all, I want to invite you to check out ResourceAwareness, a small gem that makes available information about a Rails application's resources (as defined by the 'resource/s' routing DSL methods) at Rails.application.resources. http://github.com/ingoweiss/resource_awareness You can find a

Re: [Rails] Rails acts_as_* plugins, with parameters

2010-05-23 Thread Yudi Soesanto
--Original Message-- From: Rick DeNatale Sender: rubyonrails-talk@googlegroups.com To: rubyonrails-talk@googlegroups.com ReplyTo: rubyonrails-talk@googlegroups.com Subject: Re: [Rails] Rails acts_as_* plugins, with parameters Sent: Feb 25, 2010 20:08 On Thu, Feb 25, 2010 at 7:32 AM, Paul

Re: [Rails] Rails acts_as_* plugins, with parameters

2010-05-23 Thread Yudi Soesanto
J --Original Message-- From: Rick DeNatale Sender: rubyonrails-talk@googlegroups.com To: rubyonrails-talk@googlegroups.com ReplyTo: rubyonrails-talk@googlegroups.com Subject: Re: [Rails] Rails acts_as_* plugins, with parameters Sent: Feb 25, 2010 20:08 On Thu, Feb 25, 2010 at 7:32 AM,

[Rails] Re: question on layouts

2010-05-23 Thread John Merlino
nirosh wrote: write the function @ application_controller that can be access in any controller. for more info read abt application controller doc. nirosh Hey thanks for the response. What about the image paths. This is in css and it's not linking to the images folder: background: #b8e5d1

[Rails] Rails 3 Error:uninitialized constant ActiveResource::Base

2010-05-23 Thread DmitryPush
I'v just install rails3 for try it out. I was following getting started guide: rm public/index.html, change routes... and then i try to open page i'v got an error. OS: ubunto 10.04 Rails info: dp...@dpush-desktop:~/rails_proj/blog/public$ ruby -v ruby 1.8.7 (2010-01-10 patchlevel 249)

[Rails] Rails 3 Error:uninitialized constant ActiveResource::Base

2010-05-23 Thread DmitryPush
I'v just install rails3 for try it out. I was following getting started guide: rm public/index.html, change routes... and then i try to open page i'v got an error. OS: ubunto 10.04 Rails info: dp...@dpush-desktop:~/rails_proj/blog/public$ ruby -v ruby 1.8.7 (2010-01-10 patchlevel 249)

[Rails] Re: What happens when Rails 1.3.5 is installed on top of 2.3.5?

2010-05-23 Thread pepe
I would, just in case, not being sure of the repercussions that installing a prior version of the gem would have. On May 22, 10:48 pm, Jian Lin li...@ruby-forum.com wrote: pepe wrote: Just in case it applies here is an extract from the Pickaxe book (Second edition, page 217): Threre's a

Re: [Rails] Re: question on layouts

2010-05-23 Thread Hassan Schroeder
On Sun, May 23, 2010 at 5:07 AM, John Merlino li...@ruby-forum.com wrote: nirosh wrote: write the function @ application_controller that can be access in any controller. for more info read abt application controller doc. Or create a utility controller, call it home or whatever, that handles

Re: [Rails] remote_function return No action responded error

2010-05-23 Thread Hassan Schroeder
On Sun, May 23, 2010 at 12:09 AM, nirosh kunalan.kand...@gmail.com wrote: ActionController::UnknownAction (No action responded to report_poem. Actions: create, destroy, edit, index, new, show, update): so anybody know what is the reason is? Either the generated URL is wrong -- you can check

[Rails] Re: rake db:create = LIBMYSQL.DLL not found. how to solve??

2010-05-23 Thread Manish Nautiyal
Rails Terrorist wrote: [1] gem install mysql [2] you will see like error syntac but dont pay attention to it [3] find LIBMYSQL.DLL from your mysql/bin folder in your mysql folder not ruby folder. [4] copy paste that file to ruby/bin [5] restart your server or console, if you are already

[Rails] Re: Looking for Easy Rails hosting

2010-05-23 Thread Marnen Laibow-Koser
Victor Stan wrote: I'm sure its simple on average. For me, deploying on Site5 was simpler. I also use a blank repository from which i clone my production site next to it on the server and my dev site on my local machine through ssh. Same thing, git push, git pull, don't need heroku for that,

[Rails] Re: question on layouts

2010-05-23 Thread Marnen Laibow-Koser
John Merlino wrote: Hey all, Does any have suggestions to whether I should create a controller for every web page on my site or just create an action for every web page in same controller if those actions will never require database calls? Do neither. Use a single controller action for your

[Rails] Re: List of radio buttons

2010-05-23 Thread Smok
On 21 Maj, 17:28, Hassan Schroeder hassan.schroe...@gmail.com wrote: On Fri, May 21, 2010 at 8:25 AM, Marnen Laibow-Koser li...@ruby-forum.com wrote: No, first learn about HTML form syntax (hint: the name attribute is significant here) Heh. Beat me by a minute :-) I was going to

[Rails] Re: remote_function return No action responded error

2010-05-23 Thread AGoofin
Do you have the js includes in the application layout? Happened to me a few times when playing with several projects. On May 23, 3:09 am, nirosh kunalan.kand...@gmail.com wrote: here i given my codes when i execute this remote_function rails give me this error ActionController::UnknownAction

[Rails] Re: Would you recommend some books about Ruby on Rails?

2010-05-23 Thread AGoofin
The best book on learning Rails that I have ever read is Simply Rails 2 published by Sitepoint (http://www.sitepoint.com/books/rails2/? historicredirect=rails1 ). It is laid out in a very good way and it's the only book where I went through all the examples. Later on I would recommend The Rails

[Rails] Re: Rails default date format

2010-05-23 Thread tonypm
There is also validates_date_time plugin http://agilewebdevelopment.com/plugins/validates_date_time if you also want to allow entry in other formats Tonypm -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send

Re: [Rails] Re: What happens when Rails 1.3.5 is installed on top of 2.3.5?

2010-05-23 Thread Rick DeNatale
On Sat, May 22, 2010 at 2:47 PM, pepe p...@betterrpg.com wrote: Just in case it applies here is an extract from the Pickaxe book (Second edition, page 217): Threre's a subtlety when it comes to installing different versions of the same application with RubyGems. Even though RubyGems keeps

[Rails] Re: Re: What happens when Rails 1.3.5 is installed on top of 2.3.5?

2010-05-23 Thread Jian Lin
Rick Denatale wrote: That's actually not the whole story, and excerpt from the output of gem help install: Description: The install command installs local or remote gem into a gem repository. For gems with executables ruby installs a wrapper file into the executable

Re: [Rails] Re: Newbie question about views folder

2010-05-23 Thread Rick DeNatale
On Sat, May 22, 2010 at 8:35 PM, FrankMurphy sabir.a.ibra...@gmail.com wrote: Okay, I got it to work on the domain root by editing /etc/apache2/ sites-available/default to point to the app's public directory. Is that the right way to go about it, or is that just a hack? If that's what I'm

Re: [Rails] Re: List of radio buttons

2010-05-23 Thread Hassan Schroeder
On Sun, May 23, 2010 at 7:13 AM, Smok mariusz_waszc...@tlen.pl wrote: On 21 Maj, 17:28, Hassan Schroeder hassan.schroe...@gmail.com wrote: I was going to suggest that the OP has apparently never read this http://www.w3.org/TR/html401/interact/forms.html and that it'd be an excellent place to

[Rails] Re: remote_function return No action responded error

2010-05-23 Thread nirosh
yes and sort it out. there is an entry missed in routes file -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to

Re: [Rails] Re: question on layouts

2010-05-23 Thread Bill Walton
On Sun, May 23, 2010 at 9:12 AM, Marnen Laibow-Koser li...@ruby-forum.comwrote: John Merlino wrote: Hey all, Does any have suggestions to whether I should create a controller for every web page on my site or just create an action for every web page in same controller if those actions

[Rails] Re: Looking for Easy Rails hosting

2010-05-23 Thread Victor S
With Heroku there's no git pull -- just push the code and it does everything else. The problem for me is that it wasn't that simple, the app didn't work. While in an environment like shared hosting (if were comparing low price things, Heroku has a small free option as well) I have control over

[Rails] Re: Would you recommend some books about Ruby on Rails?

2010-05-23 Thread Victor S
I would recommend things by: The Pragmatic Bookshelf http://www.pragprog.com/titles Check out the Agile Web Development With Rails... On May 22, 12:21 pm, goodchoi good...@gmail.com wrote: Hi everybody~ Vey nice to meet you on this group. I'm a only web service planner operating a site

[Rails] Questionairee's questions - how to show all user's answers? How to update database with ALL user's answers?

2010-05-23 Thread Smoq
I am using RoR 2.3.5. I would like to have list of questions with three possible answers. After having copleted a test I would like to update the database with user's answers. At the bottom of the page I would also like to list all selected answers for the user. In a table answers I have columns:

[Rails] server side programming, using the Ruby on Rails (RoR) framework help please

2010-05-23 Thread mustafacmpe
Hello , I have a home work shown below i did most of the things , i wrote rthml and database in netbeans but i cant run Homework and code i wrote are below what is missing here i dont know please help . I cant run it Implement a WEB application using the RAILS framework for maintaining an

[Rails] Introducing ResourceAwareness

2010-05-23 Thread Ingo Weiss
Hi all, I want to invite you to check out ResourceAwareness, a small gem that makes available information about a Rails application's resources (as defined by the 'resource/s' routing DSL methods) at Rails.application.resources. http://github.com/ingoweiss/resource_awareness You can find a

[Rails] Introducing ResourceAwareness 0.1.0

2010-05-23 Thread Ingo Weiss
Hi all, I want to invite you to check out ResourceAwareness, a small gem that makes available information about a Rails application's resources (as defined by the 'resource/s' routing DSL methods) at Rails.application.resources. http://github.com/ingoweiss/resource_awareness You can find a

Re: [Rails] server side programming, using the Ruby on Rails (RoR) framework help please

2010-05-23 Thread Michael Pavling
On 23 May 2010 19:40, mustafacmpe mustafa.c...@gmail.com wrote: Hello , Hello! I have a home work shown below Homework  and code i wrote are below what is missing here i dont know please help . I cant run it Well, I'm not prepared to *do* your homework for you; if you pass the course, and

Re: [Rails] Questionairee's questions - how to show all user's answers? How to update database with ALL user's answers?

2010-05-23 Thread Michael Pavling
On 23 May 2010 17:52, Smoq smoq...@gmail.com wrote: In a table answers I have columns: question, a1, a2, a3 (these columns are answers to the question), a_u (user's answer), a_ok (correct answer). Below I have pasted the view that I am using for listing questions. Surely you have a Question

[Rails] Re: Looking for Easy Rails hosting

2010-05-23 Thread Marnen Laibow-Koser
Victor Stan wrote: With Heroku there's no git pull -- just push the code and it does everything else. The problem for me is that it wasn't that simple, the app didn't work. Yes, Heroku has certain limitations. But they don't apply to most apps. While in an environment like shared hosting

[Rails] Rails/JavaScript issue

2010-05-23 Thread John Merlino
Hey all, I have an application.js file in my javascripts folder of my Ruby on Rails application. The javascript is just a typical hide/show tabs effect, so when the user clicks on one link, the corresponding div is revealed and the other divs are hidden. Two pages require the javascript. However,

[Rails] Re: [Rails 3] Trouble with named routes and form_for

2010-05-23 Thread Michael Jurewitz
I've also tried %= form_for @thread, :as = :thread % and this results in the error: undefined method `forum_threads_path' for ##Class:0x0103a45098:0x01039575a0 That would seem to be a bug to me. Shouldn't form_for be using :as = :thread to name that route appropriately? -M On May

Re: [Rails] Rails/JavaScript issue

2010-05-23 Thread Hassan Schroeder
On Sun, May 23, 2010 at 2:21 PM, John Merlino li...@ruby-forum.com wrote: document.getElementById(tabs) is NULL  var tabListItems = document.getElementById(tabs).childNodes; I think the issue is I'm calling multiple functions on page load (and hence since the one page doesn't have a tabs id

[Rails] Re: Rails/JavaScript issue

2010-05-23 Thread John Merlino
In my initial post, I did say there was an element with an id of tabs, but that it was part of another page and not the page the error occured on. However,the same js file is being used for both pages. So that's the issue I'm trying to resolve here. -- Posted via http://www.ruby-forum.com/. --

Re: [Rails] Re: Rails/JavaScript issue

2010-05-23 Thread Hassan Schroeder
On Sun, May 23, 2010 at 3:27 PM, John Merlino li...@ruby-forum.com wrote: In my initial post, I did say there was an element with an id of tabs, but that it was part of another page and not the page the error occured on. However,the same js file is being used for both pages. So that's the

[Rails] Re: Rails/JavaScript issue

2010-05-23 Thread John Merlino
Also I don't think the getElementById() method was around in 1997. -- 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 group, send email to rubyonrails-t...@googlegroups.com. To

Re: [Rails] Re: Rails/JavaScript issue

2010-05-23 Thread Hassan Schroeder
On Sun, May 23, 2010 at 3:31 PM, John Merlino li...@ruby-forum.com wrote: Also I don't think the getElementById() method was around in 1997. ? Uh, well. I explicitly referenced the line window.onload = init; so, that has what now to do with getElementById ? :-) -- Hassan Schroeder

[Rails] Re: rendering in csv file

2010-05-23 Thread Marnen Laibow-Koser
chewmanfoo wrote: I have an index page showing a table of network hosts with IP addresses, roles, hostname etc. Is it trivial to render that page to the browser as a csv file instead of html and link to that rendering on the index page? Yes. How is that done? The same way as you would

[Rails] derived model associates with a model that base associates with in a different way

2010-05-23 Thread Ali
Hello, So I have an Attribute model with lists the attributes of an object. The attributes can be of different types so I have derived classes as well, in this case I have a derived SubjectiveAttribute. The problem I'm having revolves around my User model. A user is allowed to give each attribute

[Rails] Re: Would you recommend some books about Ruby on Rails?

2010-05-23 Thread Marnen Laibow-Koser
goodchoi wrote: Hi everybody~ Vey nice to meet you on this group. I'm a only web service planner operating a site http://topics.co.kr/categories?q=iphone developed by Ruby-on-Rails engineers through payment. But I'm trying to do study Ruby on Rails by myself from now on. [...] I

[Rails] Re: attachment_fu and paperclip comparison needed

2010-05-23 Thread Tom Mac
Hi I did not get a reply to this. Any comment please? Tom -- 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 group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe

[Rails] Installing merb - connection reset, retrying, connection reset, retrying....

2010-05-23 Thread sso
This is my output. I don't know what to do to make this work. I have installed other gems without any problems. Suggestions? debian:/home/kevin# gem source -a http://www.rubygems.org http://www.rubygems.org added to sources debian:/home/kevin# gem install merb -V GET 302 Found:

[Rails] Re: Installing merb - connection reset, retrying, connection reset, retrying....

2010-05-23 Thread sso
I did gem update --system This seems to have fixed the problem. Who knows :) On May 24, 1:17 am, sso strongsilent...@gmail.com wrote: This is my output.  I don't know what to do to make this work.  I have installed other gems without any problems. Suggestions? debian:/home/kevin# gem