[Rails] Re: Format text in forums (enter, bold,...)

2009-02-13 Thread Bob Martens
Look at Textile or Markdown to make it really simple. I think there might be a javascript editor to add the tags for you, but I would recommend one of those two for simplicity's sake. On Feb 13, 12:14 pm, John Smith wrote: > I have forums in my web. I have a field in my database in my posts tabl

[Rails] Re: Which is the best way for comparing dates?

2009-02-13 Thread Bob Martens
I think you'll be good to go with that one. On Feb 13, 1:42 pm, John Smith wrote: > Thanks Fred. Those ones are the updated_at rows of two different tables. > -- > Posted viahttp://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you ar

[Rails] Re: favored development environment

2009-02-13 Thread Bob Martens
I do all development and deployment on variations of Ubuntu. I run 8.10 on my desktop, 8.04.2 on my laptop, and 8.10 Server on my development server. I use Vim exclusively and it works well for me. My recommendation is to give Ubuntu a try if you are looking at a PC and see how you like it. On F

[Rails] params

2009-02-13 Thread Vetrivel Vetrivel
How to convert params variable as hash.I am not able to convert params as a hash. -- 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 thi

[Rails] Re: Schedule job in rails

2009-02-13 Thread Valentino Lun
>> wget http://localhost:3000/cron >> >> cron_controller invokes your method > > Thanks, it is a very good idea. How about if my action require 2 > parameters? How to do that? Let me further elabroate on my question. For example in my Cron Controller def someaction some_method(params[:on

[Rails] Re: Newbie question

2009-02-13 Thread Julian Leviston
Hey man. Welcome! First thing, from hereonin, please put more meaningful subject names. We get lots of noob questions. Second, what you'd like is belongs_to association. Take a look in activerecord::base documentation at api.rubyonrails.org Blog: http://random8.zenunit.com/ Learn rails: htt

[Rails] Re: Schedule job in rails

2009-02-13 Thread Julian Leviston
That can be spoofed Blog: http://random8.zenunit.com/ Learn rails: http://sensei.zenunit.com/ On 14/02/2009, at 4:21 AM, "Jeffrey L. Taylor" wrote: > > If there are no hostile users on the server, in the controller: > > if local_request? > do the action > else > ignore or log hostile actio

[Rails] Re: Schedule job in rails

2009-02-13 Thread Valentino Lun
Mario Gutierrez wrote: > I use cron to schedule wget: > > wget http://localhost:3000/cron > > cron_controller invokes your method Thanks, it is a very good idea. How about if my action require 2 parameters? How to do that? Thanks again Valentino -- Posted via http://www.ruby-forum.com/. -

[Rails] Re: favored development environment

2009-02-13 Thread agilehack
thanks everyone- that was helpful On Feb 9, 7:31 pm, blasterpal wrote: > AgileHack, > > I work in an in-house Rails shop for a fairly large site (we are a > team of about 7 developers, not including operations and QA).  We use > OSX on PowerMacs and Mac Minis with Textmate and git. Some are > st

[Rails] Re: NoMethodError in User_photos#show

2009-02-13 Thread Ken Lim
MaD wrote: > well, the error-message is pretty clear: >> The error occurred while evaluating nil.user >> 2: � <%= link_to "#...@photo.user.username}'s Photos", > > @photo seems to be nil. the reason for it can be found in your > controller (where show is defined). I still have no clue at all as

[Rails] Re: Logging all exceptions

2009-02-13 Thread Robby Russell
On Thu, Feb 12, 2009 at 7:53 AM, koopmann.lenn...@googlemail.com wrote: > > Hey everyody, > > what is the best way to log _all_ exceptions that are thrown in my > Rails application into a database table? I need some kind of hook in > the Rails exception methods?! > > I already tried the Exception

[Rails] Re: Logging all exceptions

2009-02-13 Thread pepe
Maybe you could use callbacks? On Feb 12, 10:53 am, "koopmann.lenn...@googlemail.com" wrote: > Hey everyody, > > what is the best way to log _all_ exceptions that are thrown in my > Rails application into a database table? I need some kind of hook in > the Rails exception methods?! > > I already

[Rails] Eager fetching returning JSON results

2009-02-13 Thread Joshua Partogi
All, I have a many_to_one relationship object between products and categories and I want to return the category too using JSON results but it seems that rails only gives back the products JSON object on the view layer. This is the piece of code: @products = Product.find(:all, :include =>

[Rails] association include and joins issues - 'Unknown Column' error

2009-02-13 Thread Chris
Hi all, I'd really appreciate any help / advice on this problem. When I test this def edit @entity = Entity.find(params[:id], :include => :key_factors) @traits = Trait.find :all, :include => :trait_values, :joi

[Rails] Re: 2 button_to functions for file downloads

2009-02-13 Thread Me
Anyone have any ideas why the second button works but the first button is giving me the above error? On Feb 12, 10:27 pm, Me wrote: > For some reason the first button is giving me this for a response: > try { > $("notification").update("Site > 123 was built"); > $("downloads").show();} catch (e)

[Rails] Observe Field Problem

2009-02-13 Thread Enzo Rivello
Hi there! I need to use observe field to change dynamically one select field based on another select field: here is the view: <%= observe_field 'class', :url => { :action => 'update_list' }, :frequency => 0.25, :update => 'nickname', :with => 'tipid'

[Rails] How to stop validating after a failed validation?

2009-02-13 Thread ericindc
I want my first check to verify email address uniqueness. If this validation fails, there's no reason to go further with validating the user's input. I want a singular message displayed in this case. Is there a way to do this? Also, what about group validations, such that, for example, if I ha

[Rails] Re: gem cleanup and rails 1.2.6 problem

2009-02-13 Thread elle
gem list -d rails gives me: *** LOCAL GEMS *** rails (2.2.2, 1.2.6) Author: David Heinemeier Hansson Rubyforge: http://rubyforge.org/projects/rails Homepage: http://www.rubyonrails.org Installed at (2.2.2): /Library/Ruby/Gems/1.8 (1.2.6): /System/Library/Framewor

[Rails] Re: Fetcher with MMS2R throwing socket error

2009-02-13 Thread SnowmanInTheSun
Did you ever get this working?? I'm having a similar problem http://www.ruby-forum.com/topic/178498 --~--~-~--~~~---~--~~ 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

[Rails] Re: Fetcher Daemon Questions - receive???

2009-02-13 Thread Richard Schneeman
Did you ever figure out how to get up and running with this fetcher daemon?? I'm trying to get it working and so far, no luck... http://www.ruby-forum.com/topic/178498 -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message bec

[Rails] Re: gem cleanup and rails 1.2.6 problem

2009-02-13 Thread Charles Johnson
On Fri, Feb 13, 2009 at 2:43 PM, elle wrote: > > Running it with sudo I get: > > ERROR: While executing gem ... (Gem::InstallError) > Unknown gem rails >= 0 > > Do I need to actually sign in as root? > > > Cheers, > Elle > > You should be OK with sudo. Can you post your *exact* command line,

[Rails] Re: Number formatter

2009-02-13 Thread Michael Hasenstein
Gavin Kistner wrote: > Bah. One, final, 1.9-compatible post that also handles the edge case of > values in the range 1000...1024 of a value correctly. Thanks for the effort! Why don't you submit it to Rails so that they replace their version with yours? -- Posted via http://www.ruby-forum.co

[Rails] Re: gem cleanup and rails 1.2.6 problem

2009-02-13 Thread elle
Running it with sudo I get: ERROR: While executing gem ... (Gem::InstallError) Unknown gem rails >= 0 Do I need to actually sign in as root? Cheers, Elle On Feb 14, 2:52 am, Charles Johnson wrote: > On Thu, Feb 12, 2009 at 9:22 PM, elle wrote: > > > I've updated rails and other gems

[Rails] Help with return_back

2009-02-13 Thread John Smith
I have to log in my app, after the login I want to return back to the page I was visiting just before the redirect to the login. Now, I have this in my Sessions controller: redirect_back_or_default('/') -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~

[Rails] Re: Storing user specific settings

2009-02-13 Thread pankaj
thanks Maurício, currently all of them are binary fields about 14 of them. More may get added later. On Feb 14, 12:16 am, Maurício Linhares wrote: > It depends. > > Are they complex? Are they going to change? Is it just a bunch of > "name => value" pairs? > > If it's something simple, without c

[Rails] Re: classic pagination with custom finders/sql

2009-02-13 Thread Matt Jones
On Feb 12, 5:31 pm, Ball Balla wrote: > Say I have a user model with the following > > def active >  find(:all, :conditions => {:state => 'active'}) > end > > How can I get this working with classic pagination in my controller > without duplicating my "logic" for finding active users. ie, i do NO

[Rails] Re: Rails 2.2, abstract_class, and associations

2009-02-13 Thread Matt Jones
On Feb 12, 2:13 pm, Jim wrote: > Although, I have to wonder if there's a better way to > accomplish this than through method_missing.  Maybe there's some way > to loop through all attributes and call alias_attribute dynamically > when classes are loaded? > There is - try this: class LegacyModel

[Rails] Re: Which is the best way for comparing dates?

2009-02-13 Thread John Smith
Thanks Fred. Those ones are the updated_at rows of two different tables. -- 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,

[Rails] Re: Newbie question

2009-02-13 Thread Matt Billock
Frederick Cheung wrote: > On 13 Feb 2009, at 18:22, Matt Billock wrote: > > This doesn't find a notebook with the specified researcher_id. It just > finds a notebook (and thinking about it, how could Notebook.find know > that the parameter you were giving it was a researched_id and not > somethin

[Rails] Re: Storing user specific settings

2009-02-13 Thread Maurício Linhares
It depends. Are they complex? Are they going to change? Is it just a bunch of "name => value" pairs? If it's something simple, without complex values, you can just have a string column with a Hash serialized to YAML. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.cod

[Rails] Storing user specific settings

2009-02-13 Thread pankaj
I need to store user specific settings in database. Which is a better approach storing them in one row with each column for each setting Table columns in these case would be id, user_id, setting 1, setting 2, setting 3 etc or storing them in many rows , with setting name and value in each row

[Rails] Re: Newbie question

2009-02-13 Thread Frederick Cheung
On 13 Feb 2009, at 18:22, Matt Billock wrote: > > Hey all, > > I've been working with rails for a grand total of 8 hours, and have > run > up against the first problem I haven't been able to adequately solve > using google. > > So I've got a schema that basically consists of a bunch of > res

[Rails] Re: Which is the best way for comparing dates?

2009-02-13 Thread Frederick Cheung
On 13 Feb 2009, at 18:42, John Smith wrote: > > Is it correct to do this? > if @date_a > @date_b > puts 'hi' > end assuming those are both instances of Date, (or Time etc.) then yes. Ruby won't let you compare an instance of Date with a Time instance, and equally funny things will happen if

[Rails] Which is the best way for comparing dates?

2009-02-13 Thread John Smith
Is it correct to do this? if @date_a > @date_b puts 'hi' end -- 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

[Rails] Newbie question

2009-02-13 Thread Matt Billock
Hey all, I've been working with rails for a grand total of 8 hours, and have run up against the first problem I haven't been able to adequately solve using google. So I've got a schema that basically consists of a bunch of researchers. Each researcher has only one notebook. I'm trying to ensure

[Rails] Re: Format text in forums (enter, bold,...)

2009-02-13 Thread Mathieu Rousseau
Sorry, sleepy friday, need coffee: You could try to use tinymce or xinha. these are both WYSIWYG editors. On Fri, Feb 13, 2009 at 4:16 PM, Mathieu Rousseau wrote: > pode tentar colocar tinymce ou xinha. são 2 WYSIWYG. > > > > On Fri, Feb 13, 2009 at 4:14 PM, John Smith > wrote: >> >> I have

[Rails] Re: Format text in forums (enter, bold,...)

2009-02-13 Thread Mathieu Rousseau
pode tentar colocar tinymce ou xinha. são 2 WYSIWYG. On Fri, Feb 13, 2009 at 4:14 PM, John Smith wrote: > > I have forums in my web. I have a field in my database in my posts table > that is a textarea. > I would like to save things like press enter or use bold when I write a > message in the

[Rails] Format text in forums (enter, bold,...)

2009-02-13 Thread John Smith
I have forums in my web. I have a field in my database in my posts table that is a textarea. I would like to save things like press enter or use bold when I write a message in the forum, but it is not possible only with what an scaffold gives. I think there are some javascripts that can help. Whic

[Rails] Background Processing for CSV Exports of data

2009-02-13 Thread JimCifarelli
Hello Everyone, I'd like to provide a page where the user can click to export some data as a csv file. It would be great to have the page show a progress value for percent complete on generating the file (file generation takes between 1 and 4 minutes currently). Once complete, I can show a link

[Rails] Re: Trying to Wrap My Head Around HM:t and HABTM w/ a Sample App

2009-02-13 Thread Ar Chron
What about something like (not real code, just trying to convey the idea): Item (id, name) # an item is an item. given that you'll probably # purchase the same item more than once, you could # generate an Item list as a shopping list for your # next Costco binge has_many purchases Pur

[Rails] restful_authentication with rails 2.2

2009-02-13 Thread Rodrigo Muiño
Guys, I am using restful_authentication with rails 2.2 an realized that when a user tries to sign up the activation code that is set to his email is different from the one in the database. Do you know if this is an issue of rails 2.2? It used to work fine withe rails 2.1 Thanks Rodrigo --~--~---

[Rails] Re: Schedule job in rails

2009-02-13 Thread Jeffrey L. Taylor
If there are no hostile users on the server, in the controller: if local_request? do the action else ignore or log hostile action end HTH, Jeffrey Quoting Harold A. Gimenez : > That's a great idea, until someone in the outside finds out about that > path/resource. You're opening up too m

[Rails] Re: render js from another controller

2009-02-13 Thread Robert Walker
Robert Walker wrote: >> format.js { render :template => 'events/create_or_update' } > > I think this is the right way to do it. On second thought maybe that should be format.js { render :template => 'events/create_or_update', :layout => false } -- Posted via http://www.ruby-fo

[Rails] Re: render js from another controller

2009-02-13 Thread Robert Walker
Tarscher wrote: > Hi all, > > In my GamesController I try to render create_or_update.js that is > stored in the events view dir. Apparently Rails alwayslooks in the > games view dir. > > Is there a way I can force Rails to look in the events view dir? > > class GamesController < ApplicationCont

[Rails] Re: Mail Daemon Error

2009-02-13 Thread Richard Schneeman
Anybody?? -- 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-talk@googlegroups.com To unsubscribe

[Rails] Re: Regarding REST

2009-02-13 Thread Robert Walker
Krishna Porandla wrote: > How to write routes.rb specification to add login.rhtml and > register.rhtml files into my application. Take a look as restful_authentication plugin, even if you don't end up using it, it will show you how they do authentication RESTfully. http://github.com/technoweeni

[Rails] Re: Easy RoR <-> Javascript syntax question

2009-02-13 Thread Tom Ha
Thanks for your comment ! 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-talk@googlegroups

[Rails] Re: Schedule job in rails

2009-02-13 Thread Robert Walker
Harold A. Gimenez wrote: > That's a great idea, until someone in the outside finds out about that > path/resource. You're opening up too much and scriptkiddies can get > happy attempting a DoS. Wondering if you handle that somehow (IP address > check or something)? How about using HTTP basic auth

[Rails] Re: How to get first 10 items from hash in ruby?

2009-02-13 Thread Robert Walker
Christian van der Leeden wrote: > How about > hashTable.sort.keys[0,10].each { |key| puts "#{key} #{hashTable[key]} } This isn't going to work because hashTable.sort does not return a hash. The object returned does not have a keys method. However, reversing the chaining will work, and should ac

[Rails] Re: Trying to Wrap My Head Around HM:t and HABTM w/ a Sample App

2009-02-13 Thread Marnen Laibow-Koser
On Feb 13, 10:30 am, Marnen Laibow-Koser wrote: [...] > class Run >   has_and_belongs_to_many :users > end > > class User >   has_and_belongs_to_many :runs > end > > That will create a join table (called runs_users) associating Users > with Runs. [...] Again with the posting too quickly...I made

[Rails] can't find gems in /vendor/gems/ after modifying load_paths

2009-02-13 Thread Sarah Allen
I'm picking up a Rails app that is using a lot of older gems. We're using Rails 2.0.2 and planning to move to to Rails 2.3 along with upgrading the the dependencies. However, in the meantime, we're moving servers around and adding new folks to the dev team, so I thought it wise to "freeze" the g

[Rails] AR_Mailer Problem

2009-02-13 Thread Sean McGilvray
Hi all, I am using ar_mailer for sending newsletter. I got mails queued in emails table. However when running ar_sendmail to begin sending the mails, an exception is thrown: Unhandled exception wrong number of arguments (7 for 6) (ArgumentError): /usr/lib/ruby/gems/1.8/gems/ar_mailer-1.3

[Rails] Re: Easy RoR <-> Javascript syntax question

2009-02-13 Thread Marnen Laibow-Koser
On Feb 12, 12:13 pm, Tom Ha wrote: > Hi there, > > a simple n00b question: > > I have that Javascript snippet on my page (see below; taken from jquery, > actually). > > I want to pass it the "@cities" array from the controller. But what's > the correct syntax, here? [...] > >   $(document).ready

[Rails] Re: Schedule job in rails

2009-02-13 Thread Harold A. Gimenez
That's a great idea, until someone in the outside finds out about that path/resource. You're opening up too much and scriptkiddies can get happy attempting a DoS. Wondering if you handle that somehow (IP address check or something)? -Original Message- From: Mario Gutierrez Reply-to: rubyo

[Rails] Re: Rails & unixODBC

2009-02-13 Thread Mario Gutierrez
andypflueger wrote: > Thanks for the response. I took your advice and installed EasySoft, > but even its giving me the [ISQL]ERROR: Could not SQLConnect response > when I attempt to connect to the DSN setup during EasySoft ODBC > installation. This could be that fact I already had an installation

[Rails] Re: Schedule job in rails

2009-02-13 Thread Mario Gutierrez
I use cron to schedule wget: wget http://localhost:3000/cron cron_controller invokes your method -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" gr

[Rails] Re: Rails & unixODBC

2009-02-13 Thread andypflueger
Thanks for the response. I took your advice and installed EasySoft, but even its giving me the [ISQL]ERROR: Could not SQLConnect response when I attempt to connect to the DSN setup during EasySoft ODBC installation. This could be that fact I already had an installation of freeTDS installed and Eas

[Rails] Re: gem cleanup and rails 1.2.6 problem

2009-02-13 Thread Charles Johnson
On Thu, Feb 12, 2009 at 9:22 PM, elle wrote: > > I've updated rails and other gems following: > http://wiki.rubyonrails.org/rails/pages/HowtoUpgrade > When I try to run: gem cleanup, I get the following error: > > Cleaning up installed gems... > Attempting to uninstall rails-1.2.6 > ERROR: While

[Rails] Re: Trying to Wrap My Head Around HM:t and HABTM w/ a Sample App

2009-02-13 Thread Marnen Laibow-Koser
On Feb 13, 10:23 am, Marnen Laibow-Koser wrote: > On Feb 12, 3:11 pm, Josh Traxton > wrote: [...] > > User.rb > > # A User can participate in many runs and during the run will be buying > > Items (or maybe buying a fraction of 1 item). > > has_many :runs > > has_many :items, :through => :partici

[Rails] Re: Trying to Wrap My Head Around HM:t and HABTM w/ a Sample App

2009-02-13 Thread Marnen Laibow-Koser
On Feb 12, 3:11 pm, Josh Traxton wrote: [...] > I was hoping that someone could point me in the right direction as to > how i setup up the relationships... > > These are my models: > > Item.rb > # An item is purchased on a run and it's cost can be split between many > Users.  Because many Users c

[Rails] 2 forms + one to one relationship

2009-02-13 Thread Petan Cert
Hi, I have 2 controllers (posts and images) and one to one relationship. In my post/new.rhmtl I have two forms. One is for uploading image, the image form submit button initialize lightbox to crop the image. The second form is for post. How can I assign image I have uploaded to the article I am

[Rails] Re: Number formatter

2009-02-13 Thread Gavin Kistner
Bah. One, final, 1.9-compatible post that also handles the edge case of values in the range 1000...1024 of a value correctly. K = 2.0**10 M = 2.0**20 G = 2.0**30 T = 2.0**40 def nice_bytes( bytes, max_digits=3 ) value, suffix, precision = case bytes when 0...K [ bytes, 'b', 0 ] e

[Rails] Re: Rails & unixODBC

2009-02-13 Thread Mario Gutierrez
I am able connect to SQL Server from OSX, Archlinux. I use this adapter: http://github.com/rails-sqlserver/2000-2005-adapter/tree/master I also recommend compiling FreeTDS manually as most of the ones provided by Linux distros are out of date. Doing so would install to /usr/local/lib ~/.freet

[Rails] Re: cPanel Ruby Gems

2009-02-13 Thread Rob Pa
Michael Mike wrote: > Did you find a solution to this? I am experiencing the same problem. I contacted my host and got them to update my Ruby Gems. However I now get this message; :0:Warning: Gem::SourceIndex#search support for Regexp patterns is deprecated Cheers, Rob -- Posted via http://w

[Rails] Re: Number formatter

2009-02-13 Thread Gavin Kistner
Gavin Kistner wrote: > #=> 1b > #=> 12b > #=> 123b [...] > [ bytes, 'b', 0 ] Ack! That's twice now that I've pasted code in there with the incorrect lowercase 'b' for bytes. Should be: [ bytes, 'B', 0 ] and thus #=> 1B #=> 12B #=> 123B -- Posted via http://www.ruby-forum.com/. --~--~--

[Rails] Re: Number formatter

2009-02-13 Thread Gavin Kistner
Michael Hasenstein wrote: > That looks very acceptable to me and a lot of people. Of course, do what > you want, the only reason I post is because when *I* found this thread > looking for such a functionality I copied your code, and only then > realized there's a function already. I respond to

[Rails] Re: get subdomain in localhost

2009-02-13 Thread Robby Russell
This might help you out. http://www.robbyonrails.com/articles/2009/01/11/subdomain-accounts-with-ruby-on-rails-explained Cheers, Robby On Fri, Feb 13, 2009 at 3:32 AM, Srinath A. wrote: > > Hi, > I was wondering how to get subdomain name in my localhost. > I'm on ubuntu and set domainnames in

[Rails] Re: How to get first 10 items from hash in ruby?

2009-02-13 Thread Christian van der Leeden
How about hashTable.sort.keys[0,10].each { |key| puts "#{key} #{hashTable[key]} } Christian On 13.02.2009, at 12:45, Vikas Gholap wrote: > > Hello All, I am new to programming, i have little problem with hash. > > I want to retrieve first 10 items(key value pairs) from given hash{} > > hashTabl

[Rails] How can I retrieve the SQL during each model action?

2009-02-13 Thread xeon
Hi, I would like to know for each running model action, how can I retrieve the SQL running behind? I don't want to scan log each time for the sql running behind. E.g. post.find(:all,:conditions=>{:id=>'1'} I wanna debug the sql generated behind, is that other shorthand function like post.find().

[Rails] Re: another collection_select, HABTM, :multiple question

2009-02-13 Thread Sergio Ruiz
> collection_select(:worker, :skillset_ids, ... > holy mac! this worked spot on.. i read and reread the documentation a million times, and didn't get that.. thanks so much! -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this m

[Rails] Re: possibility to save data with javascript?

2009-02-13 Thread andi-hro
On 11 Feb., 21:41, Robert Walker wrote: > Frederick Cheung wrote: > > On 11 Feb 2009, at 12:37, andi-hro wrote: > > Well it's not rails specific at all (ie. it's just bog standard client > > side stuff) but you can make an ajax request from your javascript. The > > easiest way to get started wo

[Rails] Re: using the logger from Libs directory

2009-02-13 Thread Frederick Cheung
On 13 Feb 2009, at 12:40, Oldtimer wrote: > > > > On 13 Feb., 00:39, "sergio.sprite" wrote: >> Hello everybody, I need to log some messages from some class on Libs >> directory, do you know how can I access the logger.info from this >> directory ? is there a way to do this ? I would appreciate

[Rails] Re: paperclip attachment destroy

2009-02-13 Thread Fernando Perez
Colorblind wrote: > (or call @model.attachment.destroy) - that should do the trick. > > Doesn't work. @model.destroy will destroy both the object and file from your storage system. If it does not, it means you have customized somewhere the behavior of the attachment. Using debugger should help

[Rails] Re: using the logger from Libs directory

2009-02-13 Thread Oldtimer
On 13 Feb., 00:39, "sergio.sprite" wrote: > Hello everybody, I need to log some messages from some class on Libs > directory, do you know how can I access the logger.info from this > directory ? is there a way to do this ? I would appreciate your help, > thanks in advice if you use a rake with

[Rails] Redirect_to Vs Render_component

2009-02-13 Thread Srividya Sharma
Hello I am using Rails 2.2.2. Here is my problem: I have a controller action which will receive several parameters, validate them, process them and create a new set of parameters out of them. Then, this controller should delegate the task to another controller action based on some values and pass

[Rails] Re: How to get first 10 items from hash in ruby?

2009-02-13 Thread MaD
sorry just reread your post. of course it would be like this: hashTable.keys[1..10].each { |key| puts "#{key} => #{hash[key]}" } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To pos

[Rails] render js from another controller

2009-02-13 Thread Tarscher
Hi all, In my GamesController I try to render create_or_update.js that is stored in the events view dir. Apparently Rails alwayslooks in the games view dir. Is there a way I can force Rails to look in the events view dir? class GamesController < ApplicationController def create @event = G

[Rails] Re: How to get first 10 items from hash in ruby?

2009-02-13 Thread MaD
maybe ther is a simpler method for this, but from the top of my head i'd do it like this: hashTable.keys[1..10].each { |key| puts hash[key] } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" gro

[Rails] How to get first 10 items from hash in ruby?

2009-02-13 Thread Vikas Gholap
Hello All, I am new to programming, i have little problem with hash. I want to retrieve first 10 items(key value pairs) from given hash{} hashTable = {"a" => 1, "b" => 5, "c" => 2, "d" => 6, "e" => 4, "f" => 7, "g" => 9, "h" => 5, "i" => 1, "j" => 8, "k" => 9, "l" => 3, "m" => 7, "n" => 10, "o"

[Rails] get subdomain in localhost

2009-02-13 Thread Srinath A.
Hi, I was wondering how to get subdomain name in my localhost. I'm on ubuntu and set domainnames in /etc/hosts like this 127.0.0.1 : localhost 127.0.0.1 : tokyo 127.0.0.1 : sub.tokyo when i was using puts request.domain it was showing "tokyo" when hit URL with http://tokyo:3002 and "sub.tokyo" w

[Rails] Re: Auto_complete plugin in Rails 2.2.2 (auto_complete_for method not found)

2009-02-13 Thread Frederick Cheung
On 13 Feb 2009, at 09:19, Spiros K. wrote: > page not found" error > > * Trying to manually copy the files in the vendor/plugin directory of > my project (got them from the model_auto_completer example), but still > does not work... (if i execute "script/plugin list" there is nothing) > > Regardi

[Rails] Re: How to show error messages in pop up or confirm screen ?

2009-02-13 Thread Adriano Lul
even for validation models ? THanks!!! -- 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-talk@goo

[Rails] Re: @open_transactions initialized with nil

2009-02-13 Thread Frederick Cheung
On 13 Feb 2009, at 09:07, dbreuer wrote: > > > Is there a reason to init the variable via the attribute accessor? > > 149def open_transactions > 150 @open_transactions ||= 0 > 151end > I suspect not. You might find the rubyonrails-core list (or the #rails- contrib irc c

[Rails] Re: Building a directory tree into the database

2009-02-13 Thread patfrat
Hello, I manage a database to map directories too ... I use the plugin better_nested_set : http://wiki.rubyonrails.org/rails/pages/BetterNestedSet You can mange roots and children easily with this. When you get, for example, a directory containing others directories and files, you can add the fir

[Rails] Auto_complete plugin in Rails 2.2.2 (auto_complete_for method not found)

2009-02-13 Thread Spiros K.
Hello world, I am considering myself to be a newbie in Ruby, but not programming in general and i have a very serious problem trying to get Rails 2.2.2 to install the auto_complete plugin in Windows XP. I always get the "auto_complete_for method not found" error in ruby. After 2 days of full-inte

[Rails] Problem installing auto_complete plugin in Rails 2.2.2

2009-02-13 Thread spir...@ekt.gr Kakouris
Hello world, First of all, let me say "i am sorry" to those receiving my post for 2nd time in RubyOnRails-Talk @ Google Groups, I hope this forum [ruby-forum.com] had a switch to turn that "feature" off at will. I am considering myself to be a newbie in Ruby, but not programming in general and i

[Rails] Re: Rails & unixODBC

2009-02-13 Thread Rake NewUser
andypflueger wrote: > Hello, > > I decided to embrace getting a new Rails application to see an > existing MSSQL database and trying to get unixODBC, freeTDS, and > ActiveRecord able to query my MSSQL database. > > I'm following the procedure outlined at > http://wiki.rubyonrails.org/rails/pages

[Rails] problem with routes

2009-02-13 Thread Remco Remco
Hi, i am lost with routes I have restfull controllers with a few non-crud actions and i did this: ActionController::Routing::Routes.draw do |map| # Restful Authentication Rewrites map.resources :patienten map.resources :prestaties map.patienten "patienten/selected", :controller=>:patient

[Rails] mimic the Confirmation javascript

2009-02-13 Thread Raimon Fs
Hello, I'm using some Redbox modal windows in one application. Som of them are specific and work well, but now I want to implement a general confirmation winodow, to mimic the javascript confirm function. It started as an easy approach and now it's horribly coded and very difficult to mantain,

[Rails] Re: page.replace_html and

2009-02-13 Thread Priya Buvan
Hi, To update particular part of the page with new information, you can use Ajax.Updater in .js file. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: T

[Rails] Re: Regarding REST

2009-02-13 Thread abdul hafeez
Login function is like method "get" Register function is like method "post" The syntax for this is : map.resources :Controller_names, :Login => { :read => :get } map.resources :Controller_names, :Register => { :read => :post } Enjoiy... Regards hafeez On Fri, Feb 13, 2009 at 3:07 PM, krish

[Rails] Re: page.replace_html and

2009-02-13 Thread Raimon Fs
Mark Reginald James wrote: > Raimon Fs wrote: >> <%= render :partial => "list" %> >> >> don't see the inital records (correct), and subsequent forms submitted >> show the resulted records ok, so the .js can replace the content of the >> Div area ... > > Are you sure that your HTML is correctly

[Rails] Re: page.replace_html and

2009-02-13 Thread Mark Reginald James
Raimon Fs wrote: > Hello, > > I have a page with a form and a div area that I update after submitting > the form. > > I want to replace the Div area with new information. > > In the page, inside the div area, I have: > > > <%= render :partial => "list" %> > > > as I want to show the curre

[Rails] Regarding REST

2009-02-13 Thread krishna
How to write routes.rb specification to add login.rhtml and register.rhtml files into my application. --~--~-~--~~~---~--~~ 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 r

[Rails] Re: How to show error messages in pop up or confirm screen ?

2009-02-13 Thread Mark Reginald James
Adriano Lul wrote: > I would like to show messages when the validation fails (must be number, > cant be blank, etc) but not in the main page I would like to open a pop > up or better yet put it in a confirm screen where user would read and > thereafter click ok. render :update do |page| if ob

[Rails] Re: Schedule job in rails

2009-02-13 Thread Sijo Kg
Hi look this http://www.railsenvy.com/2007/6/11/ruby-on-rails-rake-tutorial -- 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 gro

[Rails] Re: Transaction block still sets id on model/new_record to false on rollback

2009-02-13 Thread Mark Reginald James
Farrel wrote: > I'm on Rails 2.2.2 on MySQL with InnoDB table types. I'm running into > a wierd bug where if I have two models in a transaction and the second > model raises an exception, the first model still has it's ID set and > it's new_record status set to false despite the row the ID is set

[Rails] @open_transactions initialized with nil

2009-02-13 Thread dbreuer
Hi Folks, while using the Masochism plugin for Master-Slave database setup (http://github.com/technoweenie/masochism/tree/master) I discovered a problem with starting transactions in the ConnectionProxy: 79 def transaction(start_db_transaction = true, &block) 80with_master(start_db_

[Rails] RAKE TASK using insert or update in different Platform

2009-02-13 Thread Rake NewUser
Hi, Anyone know the guideline or sample scripts for insert or update using RAKE TASK? I need to find solutions. For my main production is TABLE_1 (mysql DB - Linux) anything happens will happens also on development TABLE_1 (sqlserver DB - Windows). These both I can access now on script/console.

[Rails] using the logger from Libs directory

2009-02-13 Thread sergio.sprite
Hello everybody, I need to log some messages from some class on Libs directory, do you know how can I access the logger.info from this directory ? is there a way to do this ? I would appreciate your help, thanks in advice --~--~-~--~~~---~--~~ You received this mes

  1   2   >