[Rails] Re: Preview a post in a new window without saving it

2009-09-09 Thread Abhinav Saxena
A simple solution for that, open the preview in new window <%= link_to "Preview", "url_path", :popup => true %> For avoiding duplication, check in DB: if any post was saved with the same attributes within a time range, if yes, most likely its a duplicate (you can see more in rails space book's R

[Rails] Re: after upgrade to Snow Leopard how to upgrade MySQL to version 5.1 ?

2009-09-09 Thread erwin
in all this mess, some posts also advise not to use ports maybe the best move is NOT to move until Apple clarify it MacBook w 64-bit architecture but EFI-32 should be allowed to boot w 64 kernel... some day (no technical reason to block it but who knows the reason On 10 sep, 05:10, h

[Rails] Problen in using Open Flash Chart

2009-09-09 Thread Soutom
Hi All i am trying to use Open Flash Chart i tried this as instracted in this link http://github.com/pullmonkey/open_flash_chart/tree/master bat at finally i got the following error undefined method `open_flash_chart_object' for # At presnet i cant understand what to do. please help me to so

[Rails] Re: Preview a post in a new window without saving it

2009-09-09 Thread Ram
Hi ross, Thats what im doing right now. Im saving it as a Draft and rendering the show action for the instance @post as a preview. But that breaks 2 requirements, namely 1. The preview does not open in a new window.. its the same window. 2. There are no call to action buttons on the Preview page

[Rails] Re: autoincrement for non-id column

2009-09-09 Thread Abhinav Saxena
I still don't understand the problem completely, but will ActiveRecord::Base#increment will help? You can write an activerecord callback (before_create/after_create) and call increment on the number attribute? Reference: http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002338 Thanks, A

[Rails] load semantics of initializers and files in lib folder

2009-09-09 Thread Nathan Beyer
I've changed the subject, as I think I'm honing in on the issues I'm running into -- the loading semantics of files in the initializers folder and files in the lib folder. Is there anything to keep in mind when referencing classes in the lib folder from an initializer? It seems like the files are

[Rails] Re: Preview a post in a new window without saving it

2009-09-09 Thread s.ross
Use a state machine. posts are initially in 'draft' state, and thus can be previewed, but are not published. When publish is pressed, change the state to 'published'. You probably don't even need to manage state transition formally. Just make sure when you display posts to get only publish

[Rails] Re: use of Open flash chart

2009-09-09 Thread Soutom
Sir, Thank you so much for replying me. i tried the following link as maintioned their. but i got the following error when i start this in my browser undefined method `open_flash_chart_object' for # So for this error what should i do now.. please help me... On Sep 10, 2:19 am, Robert Walker

[Rails] Re: Singleton class setup in initializer, but seemingly relo

2009-09-09 Thread Nathan Beyer
On Sep 10, 12:44 am, Robert Walker wrote: > Nathan Beyer wrote: > > My use case is an Authentication adapter library. I want to load the > > configuration once and construct the configured adapter once and then > > use it again and again. > > If I understand you correctly I think you're looking f

[Rails] Re: belongs_to multiple things

2009-09-09 Thread Nick Green
Precisely what I'm looking for. I thought I must be missing something, somehow reading books/tutorials all at once my brain just lets some information go, and I couldn't remember the pertinent info, but I could tell my way was not "railsish". Sorry for the silly question and thanks for the ans

[Rails] Preview a post in a new window without saving it

2009-09-09 Thread Ram
Hi, Ive got a form for a blog post and there are 3 buttons - Publish, Preview and Save as Draft. Clicking on Preview should open a new window with the preview of the post without saving it while the current window stays on the "New Post" form. I dont want the post to be saved because, once the u

[Rails] Re: Singleton class setup in initializer, but seemingly relo

2009-09-09 Thread Robert Walker
Nathan Beyer wrote: > My use case is an Authentication adapter library. I want to load the > configuration once and construct the configured adapter once and then > use it again and again. If I understand you correctly I think you're looking for some like Ryan Bates demonstrates here: http://ra

[Rails] Re: 回复: How to start the ferret server i n the production environment?

2009-09-09 Thread 刘子嘉
Hoo~~Ray!!! The problem has been solved! could someone tell me why I have to write ferret_server.yml like this: . production: host: 127.0.0.1 neither .. production: host: localhost .. nor ... production: host: [the IP of my instance] ... why? It seems that I have make a stupid mistake...

[Rails] Re: belongs_to multiple things

2009-09-09 Thread Robert Walker
Nick Green wrote: > We have restaurants. Each restaurant has many menus. Each restaurant > has many dishes. Every dish /must/ belong to a menu, and every dish > /must/ belong to a restaurant (conceptually). The same dish cannot > belong to 2 different menus or restaurants (a dish with all the

[Rails] Hpricot

2009-09-09 Thread prashanth hiremath
I dont know how to re-create your Hproicot doc from the modified string please help me. Regards Prashanth --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send emai

[Rails] Re: hpricot search condition

2009-09-09 Thread prashanth hiremath
I dont know how to re-create your Hproicot doc from the modified string please help me. On Thu, Sep 10, 2009 at 10:20 AM, prashanth hiremath < prashanthhirema...@gmail.com> wrote: > > Thank u i have done what u told using gsub operator i replaces the tags to > the form as u told,but problem is t

[Rails] Re: replace html tag

2009-09-09 Thread prashanth hiremath
Thank u i have done different method m using gsub operator i replaces the tags to the form ,but problem is that if doc = Hpricot(open('Delhi.txt')) x=doc.to_s doc1=x.gsub(/<(\/?)li>/,'') puts doc1 doc1.search('span').each do |y| puts y.inn

[Rails] Re: hpricot search condition

2009-09-09 Thread prashanth hiremath
Thank u i have done what u told using gsub operator i replaces the tags to the form as u told,but problem is that if doc = Hpricot(open('Delhi.txt')) x=doc.to_s doc1=x.gsub(/<(\/?)li>/,'') puts doc1 doc1.search('span').each do |y| puts y.i

[Rails] belongs_to multiple things

2009-09-09 Thread Nick Green
I am wondering what the best way to go about this situation is from a design perspective: A has many Cs. A has many Bs. B has many Cs. Example (not the example from my real app, so hopefully it makes sense). We have restaurants. Each restaurant has many menus. Each restaurant has many dishe

[Rails] Render ERB templates via script/runner...

2009-09-09 Thread JDevine
Is there an approved, easy way to generate files via erb templates through script/runner? I need to generate a set of html files offline (via a cron job). I would like to use script/runner and use an erb template with various helpers and partials that I've already written. Googling yields one su

[Rails] Snow Leopard and raspell

2009-09-09 Thread Jason Fox
I'm having trouble with raspell after upgrading to Snow Leopard. When I start up the console in one of my apps that uses raspell I receive the following error message: Loading development environment (Rails 2.1.0) dyld: lazy symbol binding failed: Symbol not found: _new_aspell_config Reference

[Rails] Re: after upgrade to Snow Leopard how to upgrade MySQL to version 5.1 ?

2009-09-09 Thread heimdull
Why not just install mac ports and use the mysql-devel port ? --~--~-~--~~~---~--~~ 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-talk@googlegroups.com To unsu

[Rails] Re: Looking for a gem that can do full-text-search of active-record tables

2009-09-09 Thread straightfl...@gmail.com
have a look at thinking_sphinx http://freelancing-god.github.com/ts/en/ You will need sphinx installed and running but will easily wire up your AR tables as a search index Adam On Wed, Sep 9, 2009 at 7:18 PM, explainer wrote: > > Hi All, > > I have a table of 500! entries that needs to be use

[Rails] Re: Routes With Same URL Mapped To Different Actions

2009-09-09 Thread Rob Biedenharn
On Sep 9, 2009, at 7:06 PM, MaggotChild wrote: > > Can't find the answer to this. My old message received no responses > (subject was messed up). > > Is it possible to create routes that have the same URL yet map to a > different action based on the HTTP method (or pseudo method) like a > Rails'

[Rails] Rails ORM Complex query help required

2009-09-09 Thread Abm Abm
Please help me in the following query with rails ORM's style: Following is the schema create_table "accounts", :force => true do |t| t.integer "credit" t.integer "debit" t.integer "balance" t.integer "contact_id" t.datetime "created_at" t.datetime "updated_at" end create_table "companies", :force

[Rails] Re: multi user messaging

2009-09-09 Thread Matt Harrison
On Wed, Sep 09, 2009 at 04:06:36PM -0700, E. Litwin wrote: > > > If a user opens the display portion of the site, they should only see > > messages that are submitted in the future, not old ones. > > Try gem install time_machine > > Couldn't resist ;) Haha, I read that first line quickly and w

[Rails] Looking for a gem that can do full-text-search of active-record tables

2009-09-09 Thread explainer
Hi All, I have a table of 500! entries that needs to be used as a pick list, or a selection list. 500 entries is way overkill for a selection list, so I am looking for a gem/plugin that can search across stipulated fields of an AR table or tables. Any help is appreciated. --~--~-~--~---

[Rails] Re: multi user messaging

2009-09-09 Thread E. Litwin
> If a user opens the display portion of the site, they should only see > messages that are submitted in the future, not old ones. Try gem install time_machine Couldn't resist ;) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

[Rails] Routes With Same URL Mapped To Different Actions

2009-09-09 Thread MaggotChild
Can't find the answer to this. My old message received no responses (subject was messed up). Is it possible to create routes that have the same URL yet map to a different action based on the HTTP method (or pseudo method) like a Rails' resource? For example: map.resources :foo, :collection => {

[Rails] Re: multi user messaging

2009-09-09 Thread Matt Harrison
On Wed, Sep 09, 2009 at 08:57:27PM +0100, Matt Harrison wrote: > Any ideas on this would be welcomed, I've been thinking it over all day and > I can't come up with anything. I think I should clarify my intent somewhat: My system should allow one or more users to submit a form which contains a st

[Rails] Re: Already initialized constant in Rails 2.3.4

2009-09-09 Thread Jeffrey L. Taylor
I worked around the problem by applying the patches to 2.3.3. Jeffrey Quoting chris.drappier : > > I'm having the same problem.. > > On Sep 7, 5:39 pm, "Jeffrey L. Taylor" wrote: > > In Rails 2.3.4 I have the following error on my production machine, ruby > > 1.8.7 > > (2008-08-11 patchlevel

[Rails] after upgrade to Snow Leopard how to upgrade MySQL to version 5.1 ?

2009-09-09 Thread Erwin
Finally I could solve the mess in my dev environment by reverting the MySQL folder to its original version (before upgrade) so I run Leopard but no upgrade of MySQL yet ... present versions (all 32-bits as I cannot start kernel 64.. ) Rails 2.3.4 Ruby 1.8.7 MySQL-5.0.67 (libmysqlclient.1.5.dy

[Rails] Re: Singleton class setup in initializer, but seemingly relo

2009-09-09 Thread Nathan Beyer
On Sep 9, 4:10 pm, Robert Walker wrote: > Nathan Beyer wrote: > > I have a trivial Singleton class in my 'lib' folder, which has some > > instance variables that I setup by calling a configure method from an > > initializer. The initializer seems to execute just fine and sets up > > the singleton

[Rails] add_index fails for composite index

2009-09-09 Thread Gokul Janga
Anyone encountering an error with add_index and multiple columns? For example - add_index(:article_views, [:session_id,:ip_address], :unique => true, :name => 'article_views_unique') in a migration throws the following error - "wrong number of arguments (1 for 0)" but the following works fin

[Rails] Re: no method error after upgrade from 2.1 to 2.3

2009-09-09 Thread Frederick Cheung
On Sep 9, 4:55 pm, Christoph wrote: > Hi Fred, > The problem occurs on both environments. The method is defined in the > User model, so how can I change this behavior (or my code) to circumvent > this. > > Shall I look for all 'require ..' in config/initializers to see if they > are causing

[Rails] Re: use of Open flash chart

2009-09-09 Thread Robert Walker
Soutom Soutom wrote: > hi all, > please help me any one to generate a chat in my RoR application. I > just see the Open Flash Chat, is it possiable to use this with RoR. > If possable plese help me through step by step. http://github.com/pullmonkey/open_flash_chart/tree/master For instructions b

[Rails] Re: Already initialized constant in Rails 2.3.4

2009-09-09 Thread chris.drappier
I'm having the same problem.. On Sep 7, 5:39 pm, "Jeffrey L. Taylor" wrote: > In Rails 2.3.4 I have the following error on my production machine, ruby 1.8.7 > (2008-08-11 patchlevel 72) [i486-linux], but not on my development machine, > ruby 1.8.6 (2009-06-08 patchlevel 369) [i586-linux].  There

[Rails] distance_of_time_in_words_to_now and i18n

2009-09-09 Thread Fabiano Arruda
Hello, Im using this method and sometimes getting errors like this: I18n::InvalidPluralizationData in Forums#show Showing app/views/forums/show.html.erb where line #13 raised: translation data {:one=>"1 minuto", :many=>"{{count}} minutos"} can not be used with :count => 2 It only happens when

[Rails] Problems testing generated plugin

2009-09-09 Thread Adam
I'm using Rails 2.3.4. I'm trying to write a plugin, so I used the generator to create the barebones plugin. Loving TDD, I got into the test file and make some changes. Expecting them to fail I go into the plugin directory and run 'rake test.' No output--just the command showing rake_test_loader a

[Rails] Re: Singleton class setup in initializer, but seemingly relo

2009-09-09 Thread Robert Walker
Nathan Beyer wrote: > I have a trivial Singleton class in my 'lib' folder, which has some > instance variables that I setup by calling a configure method from an > initializer. The initializer seems to execute just fine and sets up > the singleton instance. However, when I reference that same sing

[Rails] Re: A basic collections/hash question

2009-09-09 Thread comopasta Gr
Hi, I managed to get over this problem. The code I'm using now is: data = params[:subcribers][:subscriber] (data.is_a?(Array) ? data : [data]).each do |d| my_record = Report.create(d) end This works fine wether I have only one subscriber or many in the XML Next will be doing a batch update.

[Rails] Re: autoincrement for non-id column

2009-09-09 Thread Marnen Laibow-Koser
adrianopol wrote: >> How is id + version different from number + version? id and number are >> both auto-incrementing. > I may have multiple objects with the same number, but with different > versions. Id is unique. Then number is not auto-incrementing, and there is no problem. There's even a R

[Rails] Singleton class setup in initializer, but seemingly reloaded later

2009-09-09 Thread Nathan Beyer
I have a trivial Singleton class in my 'lib' folder, which has some instance variables that I setup by calling a configure method from an initializer. The initializer seems to execute just fine and sets up the singleton instance. However, when I reference that same singleton instance in a controll

[Rails] use of Open flash chart

2009-09-09 Thread Soutom
hi all, please help me any one to generate a chat in my RoR application. I just see the Open Flash Chat, is it possiable to use this with RoR. If possable plese help me through step by step. with out this is there ara any other graph for RoR , then also plese help me how to inplimented that grao

[Rails] multi user messaging

2009-09-09 Thread Matt Harrison
I'm not sure what to call this system. I've been trying to create something along the lines of lmgtfy's live view[1]. It's not working badly but I'm completely stuck on one thing. It's turning more into a multi-user messaging system and I'm have trouble displaying message. It's not supposed to b

[Rails] Re: problems with habtm

2009-09-09 Thread Eric
it looks all wrong to me, and overconfigured too. check some tutorials. Category habtm :empresas Empresa habtm :categories CategoryEmpresa belongs_to :category belongs_to :empresa http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#M001836 On Sep 9, 11:28 am, Paŭ

[Rails] Re: UltraSphinx for Rails

2009-09-09 Thread Joe Peck
> > thanks for answer, > 1) but how can i get data from other tables(my_prof, my_country, > my_space, my_languages)?(I want to get data near as SQL query(that i > write in config/ultrasphinx/development.conf) is returned) > 2) Can US also returned data from users, my_prof, my_country, my_space,

[Rails] Re: map.resources :controller and form_for

2009-09-09 Thread Perceptes
Trying it again, using :on did what I was expecting. I think I most have mistakenly tried used alias_path instead of original_path when I was trying it the first time. Case closed! Thanks again! On Sep 9, 12:11 pm, Perceptes wrote: > I actually used :as before using :controller, and while it rec

[Rails] Re: map.resources :controller and form_for

2009-09-09 Thread Perceptes
I actually used :as before using :controller, and while it recognized routes using the "aliased" name, the URL helpers generated links using the "real" name. Perhaps I was using the wrong helpers, though. I will look into it again. Thanks for your response! On Sep 9, 3:03 am, Abhinav Saxena wrot

[Rails] Re: autoincrement for non-id column

2009-09-09 Thread adrianopol
> How is id + version different from number + version? id and number are > both auto-incrementing. I may have multiple objects with the same number, but with different versions. Id is unique. > I don't see how Java is going to make this problem (with the design) > go away. There is a little 'fram

[Rails] problems with habtm

2009-09-09 Thread Paŭlo Geyer
hi, i'm having some problems with habtm association, when i try to list Empresas form a Category, i get the association ID instead of the Empresa ID, i'm using sqlite3 >> paulo-geyers-macbook:100empresas paulo$ ./script/console Loading development environment (Rails 2.3.4) >> Category.find(:first

[Rails] Re: Tagging recommendation - acts_as_taggable_on_steroids best?

2009-09-09 Thread Philip Hallstrom
> What's the most popular tagging plugin/gem these days? Is it > acts_as_taggable_on_steroids? Or is something else better? Dunno. I recently (3 months ago) had to pick and went with acts-as- taggable-on. Seems to work just fine. Lets you have different "sets" of tags per model which I do

[Rails] Re: autoincrement for non-id column

2009-09-09 Thread E. Litwin
How is id + version different from number + version? id and number are both auto-incrementing. I don't see how Java is going to make this problem (with the design) go away. On Sep 9, 10:36 am, adrianopol wrote: > It is for versioning. I have a pair (number, version) as another > method to ident

[Rails] Re: Querying with Ruby date ranges

2009-09-09 Thread Marnen Laibow-Koser
Mukund wrote: > Ruby handles date ranges as integers internally so it is a bad idea to > try that. You can do something simpler using the array syntax of > conditions > > :conditions => ["received_date >= ? and received_date > <= ?",posted_date, posted_date] > > This will form the necessary SQ

[Rails] Re: autoincrement for non-id column

2009-09-09 Thread adrianopol
It is for versioning. I have a pair (number, version) as another method to identificate a row in the table, so "number" and "id" are absolutely independent. So, to my mind, more low-level language and libraries are better in this situation. On Sep 9, 9:17 pm, Marnen Laibow-Koser wrote: > adriano

[Rails] [URGENT] cannot continue my devs, big mess with Apple Snow Leopard !

2009-09-09 Thread Erwin
I don't understand anymore what to do with SL .. .. I have an Apple Macbook 2.16GHz Intel Core 2 Duo upgraded to SL 10.6 it should be a 64 architecture but cannot start kernel in 64 ... because of EFI32 :-(( $ ioreg -l -p IODeviceTree | grep firmware-abi | | "firmware-abi" = <"EFI32">

[Rails] Re: autoincrement for non-id column

2009-09-09 Thread Marnen Laibow-Koser
adrianopol wrote: > Thanks! Frankly speaking, I've decided to use java for this project. > It's not good to fight with framework's logic) So learn it instead of fighting with it. Anyway, while I'm surprised that Rails migrations can't do what you want here, I also can't see how more than one a

[Rails] Re: hpricot search condition

2009-09-09 Thread Ar Chron
Your html is still flat, so you have to work with the patterns that you see. You have: span li li li span li li li etc... An ugly, brute force, one case solution is to: read the page with Hpricot remove the header convert it to a simple string representation stick your opening tag '' at the hea

[Rails] Re: to_xml and timezones

2009-09-09 Thread Robert Walker
Allen Walker wrote: > When i call model_object.to_xml, there is a DateTime field and it's > displayed as such: 2009-08-25T16:32:06Z > > Is there anyway to modify the display format to say the format like > Time.now.utc?, i.e. 2009-09-09 03:14:20 UTC > > thanks Time formats in XML are standardiz

[Rails] Re: Help on ruby on rails for mobile website development

2009-09-09 Thread Robert Walker
Marnen Laibow-Koser wrote: > And for God's sake, if you do have to make a mobile site, provide a link > to the full site. Some of us really hate crippled functionality. +1 -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message

[Rails] Re: Related JavaScript

2009-09-09 Thread Rick DeNatale
On Wed, Sep 9, 2009 at 12:21 PM, Marnen Laibow-Koser wrote: > > James Englert wrote: >> Interestingly, the browser apparently can load the page quicker if >> javascript is at the bottom. >> >> http://developer.yahoo.com/performance/rules.html >> > > That's a bizarre set of recommendations, especia

[Rails] Re: Related JavaScript

2009-09-09 Thread Marnen Laibow-Koser
James Englert wrote: > Interestingly, the browser apparently can load the page quicker if > javascript is at the bottom. > > http://developer.yahoo.com/performance/rules.html > That's a bizarre set of recommendations, especially given that Doug Crockford, Yahoo!'s own JS architect, recommends t

[Rails] Tagging recommendation - acts_as_taggable_on_steroids best?

2009-09-09 Thread Max Williams
hey all What's the most popular tagging plugin/gem these days? Is it acts_as_taggable_on_steroids? Or is something else better? I'd like to basically replicate flickr's tagging as much as possible, eg allowing multi-word tags to be denoted by quotes or seperated by commas. thanks max -- Post

[Rails] Re: pagination problem...

2009-09-09 Thread Matt Jones
On Sep 9, 2:06 am, Venkat Eee wrote: > Please note: I don't want to use any plugins and please help to > implement.. You don't want to use any plugins? Then you either need to get a new job or stop asking rails-talk to do your homework... Seriously though, mislav-will_paginate on github does

[Rails] Re: trouble trying rjs

2009-09-09 Thread Matt Harrison
On Wed, Sep 09, 2009 at 04:53:13PM +0100, Matt Harrison wrote: > try { > } catch (e) { alert('RJS error:\n\n' + e.toString()); alert(''); throw e } I'm sorry for the line noise, I seem to have found the problem. It ocurred to me that both the periodically_call_remote and the rjs were both specify

[Rails] Re: no method error after upgrade from 2.1 to 2.3

2009-09-09 Thread Christoph ----
> probably issues with the code reloading stuff (if this is happening in > development) or the code preloading (if this is happening in > production) > For the former errant requires are often a cause. For the latter this > can be due to the fact that models are now loaded before the code at > the

[Rails] retrieve text from popup

2009-09-09 Thread Bob Smyph
I am using the following code to click on a popup, and would like to be able to retrieve the text which is displayed in the popup. Does anyone have any suggestions as to how to do this? def startClicker(ie, button , waitTime = 4) w = WinClicker.new longName = ie.dir.gsub("/" , "\\" ) sh

[Rails] trouble trying rjs

2009-09-09 Thread Matt Harrison
Hi guys, I've done a tiny bit of ajax before, but now I'm trying out rjs templates and functions. I'm trying to re-create something like http://live.lmgtfy.com with periodically_call_remote. The problem is when I try to use an rjs template, or rjs in the controller. I've got a controller action

[Rails] Re: no method error after upgrade from 2.1 to 2.3

2009-09-09 Thread Frederick Cheung
On Sep 9, 4:16 pm, Christoph wrote: > Hi, > I am trying to upgrade my existing 2.1 rails application to 2.3.3. > Everything works fine in 2.1. > Now after the upgrading I get either "stack level too deep" errors or > "undefined method errors" if a I have requests in parallel or shortly > a

[Rails] no method error after upgrade from 2.1 to 2.3

2009-09-09 Thread Christoph ----
Hi, I am trying to upgrade my existing 2.1 rails application to 2.3.3. Everything works fine in 2.1. Now after the upgrading I get either "stack level too deep" errors or "undefined method errors" if a I have requests in parallel or shortly after another (like I press f5 quickly twice). The first

[Rails] Paperclip attachment to AWS - ActiveRecord::AssociationTypeMismatch Going Nuts!

2009-09-09 Thread Jonathan Fagan
Hi, I have been trying to do this for a few days now and cannot figure it out. I would be very grateful is anyone can help me I am trying to upload an attachment to AWS, S3 using paperclip, however every time I keep getting this error: ActiveRecord::AssociationTypeMismatch in ProjectController#c

[Rails] Re: Let me introduce myself

2009-09-09 Thread JimCifarelli
Hello Jeff, Nice site. I like the design. Clean and to the point. Two small items to mention: 1. The errors displayed when submitting a blank "Sign Up" form seem pink while the form elements are red. Perhaps nix the pink box and just leave a matching red "X" and red message text. 2. In the "S

[Rails] Re: Help on ruby on rails for mobile website development

2009-09-09 Thread Marnen Laibow-Koser
Sattu wrote: > hi all, > > I am trying to implement a website on the mobile device. The > website is written in RoR and currently runs for desktop and laptop > users. > I have started learning RoR with Instant Rails. Could anyone guide me > about how should i move forward, like any reference

[Rails] Re: Help on ruby on rails for mobile website development

2009-09-09 Thread bill walton
Hi Sattu, On Tue, 2009-09-08 at 20:08 -0700, Sattu wrote: > hi all, > > I am trying to implement a website on the mobile device. The > website is written in RoR and currently runs for desktop and laptop > users. If I understand your question correctly, I'd recommend that you google 'web de

[Rails] Re: Help on ruby on rails for mobile website development

2009-09-09 Thread Robert Walker
Robert Walker wrote: > You can then use the ACCEPTS header or URL extension just like you would > for the XML representation: > > http://localhost:3000/posts.mobile > http://localhost:3000/posts/1.iphone > etc. Oops. These URL should have been for people rather than posts to match the rest of

[Rails] Re: Help on ruby on rails for mobile website development

2009-09-09 Thread Robert Walker
Sattu wrote: > hi all, > > I am trying to implement a website on the mobile device. The > website is written in RoR and currently runs for desktop and laptop > users. > I have started learning RoR with Instant Rails. Could anyone guide me > about how should i move forward, like any reference

[Rails] Re: replace html tag

2009-09-09 Thread Frederick Cheung
On Sep 9, 12:50 pm, prashanth hiremath wrote: > Hi > >  Please help me i want to replace the tag > >    to   at time > > can anybody in world give me an solution > A little more context would be helpful. Fred > Regards > > Prashant --~--~-~--~~~---~--~~ You r

[Rails] Re: Model attributes calling helper function?!

2009-09-09 Thread Lee Fyock
There was another model that was including ApplicationHelper for some godforsaken reason. Taking that out fixed the problem. I'm still unclear why and how this was happening. Lee On Sep 4, 11:32 am, Frederick Cheung wrote: > On Sep 4, 4:17 pm, LeeFyock wrote: > > > I have a totally wacked pro

[Rails] Re: Related JavaScript

2009-09-09 Thread James Englert
Interestingly, the browser apparently can load the page quicker if javascript is at the bottom. http://developer.yahoo.com/performance/rules.html -Jim http://www.thepeoplesfeed.com On Wed, Sep 9, 2009 at 5:08 AM, Abhinav Saxena wrote: > Ideally, javascript should be kept in head section of htm

[Rails] Re: A basic collections/hash question

2009-09-09 Thread comopasta Gr
Hi Mukund, thanks for the suggestions! I did try > params[:subscribers].each do |subscriber_hash| puts subscriber_hash >my_record = Subscriber.new(subscriber_hash) >my_record.save > end if params[:subscribers] The result is that subscriber_hash results in subscriber nameSixmsidsm5

[Rails] [Rspec] Using Mocha results in uninitialized constant, using a 'fix' breaks RSpec output

2009-09-09 Thread Lb2007
After installation of Mocha (0.9.7), running "script/spec spec" results in a "`const_missing': uninitialized constant Test::Unit::TestResult::TestResultFailureSupport (NameError)" error. (As shown here; http://codepad.org/mTqztjwt ) I'm running Ruby 1.8.6 with Rails 2.3.4 on Windows, rspec (-rails

[Rails] Re: how to implement get and set method in ruby on rails

2009-09-09 Thread Frederick Cheung
On Sep 9, 10:15 am, Abhinav Saxena wrote: > Simplest one: >   attr_accessor :variable_name   # this will generate get and set method for > you > But don't do this for database backed attributes - for those the accessor methods are added for you. Fred > If you meant how to write get & set met

[Rails] Re: Related JavaScript

2009-09-09 Thread HUNT HUNT
Abhinav Saxena wrote: > Error says it all: you do not have "create" action in your controller. > Add it, it's not a javascript issue anymore. > > Thanks, > Abhinav > -- > अभिनव > http://twitter.com/abhinav > > > > > On Wed, Sep 9, 2009 at 5:29 PM, HUNT I haven't created any action in the con

[Rails] Re: Related JavaScript

2009-09-09 Thread Puneet Pandey
Dude your javascript is not getting loaded when your submit button is pressed.. look carefully when you are calling javascript.. try to alert some text to see what's going wrong there On Wed, Sep 9, 2009 at 5:29 PM, HUNT HUNT wrote: > > Tried again, > > this time the output is a new page with > >

[Rails] Re: Related JavaScript

2009-09-09 Thread Abhinav Saxena
Error says it all: you do not have "create" action in your controller. Add it, it's not a javascript issue anymore. Thanks, Abhinav -- अभिनव http://twitter.com/abhinav On Wed, Sep 9, 2009 at 5:29 PM, HUNT HUNT wrote: > > Tried again, > > this time the output is a new page with > > Unknown act

[Rails] Re: Pass Ruby Array to Javasript Problem ..

2009-09-09 Thread Hemant Bhargava
Thanks resolved .. Resolved using javascript .. Manipulating that array in javascript only .. :) Mukund wrote: > Use JSON for passing array data between Ruby and Javascript. I think > you missed the #{} inside the string above. > > <%= radio_button "ab", "cd", { :onclick => "abc(# > {weight_ar

[Rails] Re: Related JavaScript

2009-09-09 Thread HUNT HUNT
Tried again, this time the output is a new page with Unknown action No action responded to create. can see the attached file.. Attachments: http://www.ruby-forum.com/attachment/4020/Screenshot.png -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~

[Rails] Re: Hide image name

2009-09-09 Thread sam rlo
Felix Schäfer wrote: > Am 09.09.2009 um 11:01 schrieb sam rlo: > >> I want to hide the image name of an image when mouse over an Image.how >> can i hide the image name. > > > What Browser? What does the code in the view look like? What is the > resulting html? ... > > Felix I found this issue

[Rails] replace html tag

2009-09-09 Thread prashanth hiremath
Hi Please help me i want to replace the tag toat time can anybody in world give me an solution Regards Prashant --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to th

[Rails] Re: Related JavaScript

2009-09-09 Thread Puneet Pandey
function validate(){ if($('search').value==''){ alert("Please enter keyword(s) to search."); return false; } else{ return true; } } <% form_tag ({:action=>'create'}, {:onsubmit=>'return validate()'}) do %> <% end

[Rails] Re: How to start backgroundrb server on server reboot ??

2009-09-09 Thread Mukund
Use delayed_job instead of backgroundrb if your application is large and you need more than one worker. backgroundrb starts one application process per worker which eats up RAM. On Sep 9, 11:13 am, Sandip Ransing wrote: > Hello > > How do i start backgroundrb server on server reboot ?? > > Than

[Rails] Re: Querying with Ruby date ranges

2009-09-09 Thread Mukund
Ruby handles date ranges as integers internally so it is a bad idea to try that. You can do something simpler using the array syntax of conditions :conditions => ["received_date >= ? and received_date <= ?",posted_date, posted_date] This will form the necessary SQL for the database query. O

[Rails] page.assign display assigned value

2009-09-09 Thread prabesh shrestha
I can assign the value with <%=link_to_function("alert", nil, :id => "alert") do |page| page.assign 'count', 1 page.alert(count) end %> How can I use the value of count once I assign it some value? Thanks. --~--~-~--~~~---~--~~ You received this messag

[Rails] Re: Traversing nested ActiveRecord associations

2009-09-09 Thread Mukund
Where is the belongs_to :town in the Street Model? class Town < ActiveRecord::Base has_many :streets has_many :houses, :through => :streets end class Street < ActiveRecord::Base belongs_to :town has_many :houses end You can then do Town.first.houses just fine. On Sep 9, 4:25 pm, steven

[Rails] Re: Related JavaScript

2009-09-09 Thread HUNT HUNT
Hey Puneet, The code which u send I tried with that..it is not validating instead it goes blank page saying undefined template. THanks Hunt -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed

[Rails] Re: Pass Ruby Array to Javasript Problem ..

2009-09-09 Thread Mukund
Use JSON for passing array data between Ruby and Javascript. I think you missed the #{} inside the string above. <%= radio_button "ab", "cd", { :onclick => "abc(# {weight_array.to_json})"; } %> On Sep 9, 2:26 pm, Hemant Bhargava wrote: > I have an array named weight_array. Now i want to pass i

[Rails] Re: Traversing nested ActiveRecord associations

2009-09-09 Thread steven_noble
OK, I added a town_id to each house and it's working fine, but if there's a method I've missed that handles this automagically, it'd be great to know. s. On Sep 8, 10:21 pm, steven_noble wrote: > Let's say... > > class Town < ActiveRecord::Base >   has_many :streets >   has_many :houses, :throu

[Rails] Re: A basic collections/hash question

2009-09-09 Thread Mukund
params[:subscribers].each do |subscriber_hash| my_record = SubscriberModel.new(subscriber_hash) my_record.save end if params[:subscribers] Assuming that SubscriberModel is an activerecord model that maps to a table with similar layout as the hash. Otherwise, define your own class with an i

[Rails] Re: undefined method `attr_accessor' for #

2009-09-09 Thread Abhinav Saxena
Moreover, whatever you are trying to do in rails also, I believe, is wrong & unnecessary. -- अभिनव http://twitter.com/abhinav On Wed, Sep 9, 2009 at 4:14 PM, Venkat Eee wrote: > > In application_helper.rb > > def get_set(var) >  attr_accessor :myvar >        myvar = var > end > > In controller

[Rails] Re: undefined method `attr_accessor' for #

2009-09-09 Thread Abhinav Saxena
Sir, sir, sir.. what are you trying to do. Please study Ruby basics before writing any Rails code. This will help: http://www.rubyist.net/~slagell/ruby/accessors.html -- अभिनव http://twitter.com/abhinav On Wed, Sep 9, 2009 at 4:14 PM, Venkat Eee wrote: > > In application_helper.rb > > def get_

  1   2   >