[Rails] Avoiding Clutter in views

2008-12-13 Thread Rishav Rastogi
Hi, I have seen that when using rails for big applications especially the ones with a lot of dynamic content. for example: profile pages in social network apps, newspaper websites etc. The Views in such rails apps seem to have a lot of clutter, lots of render statements, 'if' statements etc.etc.

[Rails] Re: Problems installing mysql gem in Windows Vista

2008-12-13 Thread TonyB
Hi Schalk I had the same problem with rails 2.2.2 ... ArgumentError (NULL pointer given): (eval):3:in `each_hash' (eval):3:in `all_hashes' I my case I was running MySQL 5.1.30 on a Windows environment too so I decided to switch 'back' to MySQL 5.0.67 and this worked for me. So maybe

[Rails] Re: Fetching checkbox name from database

2008-12-13 Thread Navi023
Anyone out there? please have a look at my query also. :( On Dec 11, 2:48 pm, Navi023 navneet030...@gmail.com wrote: some one please help me out. :( On Dec 11, 8:49 am, Navi023 navneet030...@gmail.com wrote: currently i am using this in my view, which makes it pretty hard coded...can u

[Rails] How to find radio button selection when a form is submitted?

2008-12-13 Thread rajesh
How to find radio button selection when a form is submitted? http://interviewdoor.com/questions-faqs/viewtopic.php?f=155t=1150 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to

[Rails] Re: Problem with parameters

2008-12-13 Thread joripel
The problem is that in the view when i push the button it works like a link_to and tabla y codigo_aleatorio aren't present in elijovista :( Any help? I don't know how solve this --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[Rails] Is Rails suitable for highly customized standard software

2008-12-13 Thread Andy Meyer
Hello, I am working in a small software company. We are developing business applications for a very niche industry. At the moment our software products are mainly fat client windows applications which are accessing different kinds of database servers. Now we plan to slowly move to web

[Rails] Issue with scaffolding with rails 2.2 and mySQL

2008-12-13 Thread Stephen Morrison
Hi guys, I'm having problems when creating basic web applications using rails 2.2 and mySQL databases. If I create the following table in a database named moviecritc_development: CREATE TABLE movies ( id INT NOT NULL AUTO_INCREMENT PRIMARY_KEY, name VARCHAR(30) NOT NULL ); and then run

[Rails] AuthLogic Help

2008-12-13 Thread Davo
Hi all, I'm playing around with AuthLogic it looks really nice... But I'm having trouble setting it up with other controllers. The examples just using the user model/controller But say I want to incorporate it with a blog app, how do I integrate it ? For example say I want the admin logged

[Rails] REST v/s SOAP

2008-12-13 Thread Sijo Kg
Hi Could any body please comment on this? Each pros and cons(if any) Can REST do all things that SOAP does Thanks in advance Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[Rails] Re: Problem with parameters

2008-12-13 Thread Frederick Cheung
On Dec 12, 2:49 pm, joripel jori...@msn.com wrote:     case :tabla         when Famitel These lines here are also weird. The lines below would only run if :table were to be === to Famitel, which would never happen. (did you mean params[:tabla] ? Fred         �...@ticket=ticket.find(

[Rails] Issue with scaffolding with rail 2.2 and mySQL

2008-12-13 Thread Stephen Morrison
Hi guys, I'm having problems when creating basic web applications using rails 2.2 and mySQL databases. If I create the following table in a database named moviecritc_development: CREATE TABLE movies ( id INT NOT NULL AUTO_INCREMENT PRIMARY_KEY, name VARCHAR(30) NOT NULL ); and then run

[Rails] Re: Issue with scaffolding with rail 2.2 and mySQL

2008-12-13 Thread Frederick Cheung
On Dec 13, 11:11 am, Stephen Morrison stephen.dmorri...@gmail.com wrote: Hi guys, I'm having problems when creating basic web applications using rails 2.2 and mySQL databases. If I create the following table in a database named moviecritc_development: CREATE TABLE movies (     id INT NOT

[Rails] Re: Need Help in converting php encryption decryption code to ruby on rails

2008-12-13 Thread Andrius Chamentauskas
Even though i think you should use some known encryption algorythm, here's translated source (not tested): require 'digest/md5' require 'base64' class String def ^(value) rez = self.length.times { |i| rez (self[i] ^ value[i % value.length].to_i) } rez end end def

[Rails] Re: Where do I start?

2008-12-13 Thread Simon St.Laurent
On Dec 10, 3:27 pm, Painting With Purpose christhorn...@gmail.com wrote: I want to become a Rails web developer.  I am not a programmer by any means.  I have built one static website and am familiar with HTML and CSS.  I know I'll need to learn Rails, and perhaps a list of other things like

[Rails] Re: REST v/s SOAP

2008-12-13 Thread Margareth Florián
Hi, Sijo SOAP and REST are different thinks. SOAP is and envelop protocol like HTTP. REST is a design style for a stateless client-server architecture. in REST a web service is viewed as a resource and it is accesed trough its URI. Margareth 2008/12/13 Sijo Kg rails-mailing-l...@andreas-s.net

[Rails] Re: Params error with: complex form+multiple models

2008-12-13 Thread David Sousa
Does any one know how to fix? Or any suggestion will be ok. I did not find the solution yet. David Sousa -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails:

[Rails] Re: jQuery Rails Functions

2008-12-13 Thread DAZ
Thanks again Simon - your help is very much appreciated! Here are a few things I have found out - in case anybody else is reading this: * To get the authenticity tag to work you need this somewhere in your view: %= javascript_tag window._token = '#{form_authenticity_token}' if

[Rails] What is The Rails Way to do this?

2008-12-13 Thread Patrick Doyle
I have a PHP application with the following in one of the views: input type=button onClick=newAlt() value= + /nobr The JavaScript for newAlt() is: // using DOM create new input box for alternate part function newAlt() { var html = input style='background-color:#CC' ; html +=

[Rails] Re: Params error with: complex form+multiple models

2008-12-13 Thread Frederick Cheung
On Dec 13, 3:22 pm, David Sousa rails-mailing-l...@andreas-s.net wrote: Does any one know how to fix? Or any suggestion will be ok. I did not find the solution yet. Given that it's an ajax form (ie serialized by prototype), it's worth checking that you form elements have unique dom ids as

[Rails] Unobtrusive Javascript in Rails

2008-12-13 Thread DAZ
Hi everybody, I love using rails, but one of my major problems with it has always been how the helper methods create some really ugly inline javascript. I've recently found jQuery after watching Ryans brilliant Railscast about it (http://railscasts.com/episodes/136-jquery). I think that jQuery

[Rails] Re: What is The Rails Way to do this?

2008-12-13 Thread Frederick Cheung
On 13 Dec 2008, at 15:49, Patrick Doyle wrote: I have a PHP application with the following in one of the views: input type=button onClick=newAlt() value= + /nobr The JavaScript for newAlt() is: // using DOM create new input box for alternate part function newAlt() { var html =

[Rails] need to initialize contant arrays , where to do it...

2008-12-13 Thread Erwin
I need to load names, from the table 'domains' into an array (frequently used in my app..) ALL_DOMAINS = Domain.find(:all).map { |d| d.name }.compact I tried to write it in an initialize or in my application.rb BUT problem : when I run a rake db:migrate initially (after creating the

[Rails] Re: CookieOverflow errors while using DB cookie store

2008-12-13 Thread brady8
Thanks for the reply Fred! Any idea then why it would switch to using the cookie store? Session data in general for the app is being stored/accessed from the database using AR. From environment.rb: config.action_controller.session = { :session_key = '_myapp_session', :secret =

[Rails] Re: What is The Rails Way to do this?

2008-12-13 Thread Patrick Doyle
On Sat, Dec 13, 2008 at 11:34 AM, Frederick Cheung frederick.che...@gmail.com wrote: On 13 Dec 2008, at 15:49, Patrick Doyle wrote: I have a PHP application with the following in one of the views: input type=button onClick=newAlt() value= + /nobr The JavaScript for newAlt() is:

[Rails] Bug with assert_select and javascript?

2008-12-13 Thread Colin Law
Hi, I am using Rails 2.2.2 and have some javascript in my html.erb file in the body of the document, inside script tags. The script (which works as intended) contains the line for(var i=0; iboxes.length; i++) In my functional tests I use assert_select and it is generating a warning ignoring

[Rails] Re: Fetching checkbox name from database

2008-12-13 Thread Hassan Schroeder
On Wed, Dec 10, 2008 at 7:49 PM, Navi023 navneet030...@gmail.com wrote: currently i am using this in my view, which makes it pretty hard coded...can u suggest something else in place of it(which dynamically fetches the checkbox names from a database) Also, I want to use two databases(one

[Rails] Updates using urls and query strings

2008-12-13 Thread DAZ
I have a task model and in the controller there is this code that sets the date a task was completed on if params[:completed] comes back as true and sets the completed_by field to nil (ie incomplete) if params [:completed] comes back as false: @task.completed_on = params[:completed] ?

[Rails] Re: Updates using urls and query strings

2008-12-13 Thread Frederick Cheung
Does anybody know why this isn't working? I've a feeling it might be because ruby is seeing 'false' as a string and therefore 'true'. Precisely. all parameters are just strings, it's up to you to coerce it to a boolean value cheers, DAZ

[Rails] Re: Bug with assert_select and javascript?

2008-12-13 Thread Frederick Cheung
On 13 Dec 2008, at 17:04, Colin Law wrote: Hi, I am using Rails 2.2.2 and have some javascript in my html.erb file in the body of the document, inside script tags. The script (which works as intended) contains the line is the javascript inside a ![CDATA[ section ? fred for(var i=0;

[Rails] Re: Bug with assert_select and javascript?

2008-12-13 Thread Colin Law
Frederick Cheung wrote: On 13 Dec 2008, at 17:04, Colin Law wrote: Hi, I am using Rails 2.2.2 and have some javascript in my html.erb file in the body of the document, inside script tags. The script (which works as intended) contains the line is the javascript inside a ![CDATA[

[Rails] Capture session end of life routine? def session_has_ended?

2008-12-13 Thread Peter Alvin
Does RoR define a routine that runs _guaranteed_ when a session ends to write out session info to database, etc.? Pete -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby

[Rails] Simple Question: How do I install Authlogic w/o git?

2008-12-13 Thread David Dennis
I don't think I'm going to figure out how to install Git anytime soon. The install fails everytime I issue a make. The authlogic plugin page only offers a git repository (git://github.com/binarylogic/authlogic.git ) and I can't find an svn repository for it which would make my life easier. Is

[Rails] Re: Updates using urls and query strings

2008-12-13 Thread DAZ
Thanks for the reply Frederick, I just have two questions: 1) How exactly do I coerce it into a boolean value - is there a best- practice way of doing this? 2) How come this problem doesn't occur when the value is submitted via the form from the edit action? cheers, DAZ On Dec 13, 5:28 pm,

[Rails] Re: Simple Question: How do I install Authlogic w/o git?

2008-12-13 Thread Frederick Cheung
On 13 Dec 2008, at 18:43, David Dennis wrote: I don't think I'm going to figure out how to install Git anytime soon. The install fails everytime I issue a make. The authlogic plugin page only offers a git repository (git://github.com/binarylogic/authlogic.git ) and I can't find an svn

[Rails] What is the right way to upload my Rails application?

2008-12-13 Thread David Dennis
Hi all, I've been developing with Rails for about two weeks now. Just met a deadline where we already have users, comments, and some other cool app logic up on the site. This framework is a dream next to Struts. The issue is, I've been doing things quick and dirty, but because if I expect the

[Rails] Re: Simple Question: How do I install Authlogic w/o git?

2008-12-13 Thread David Dennis
Frederick Cheung wrote: On 13 Dec 2008, at 18:43, David Dennis wrote: I don't think I'm going to figure out how to install Git anytime soon. The install fails everytime I issue a make. The authlogic plugin page only offers a git repository (git://github.com/binarylogic/authlogic.git )

[Rails] Re: Is Rails suitable for highly customized standard software

2008-12-13 Thread Andrew Bloom
I would say go for it. There are a number of ways to approach your situations. A simple solution might be to create plugins with models and controllers, and build a different app for each client, basically providing the views and configuration. More complex and powerful alternatives exist of

[Rails] Re: [JOBS] Looking for a ROR Programmer

2008-12-13 Thread Chris Conrey
I work on a team of Rails developers at Integrum (http://integrumtech.com) that can build whatever it is you have in mind. We work under an iterative process to build software for our clients with an emphasis on speed and client communication. If that is something you're interested in, let me

[Rails] Re: Active Record - find - select option

2008-12-13 Thread Bharat Ruparel
Hello Mark, Priya, and Fred, I sincerely appreciate you all taking trouble to share your knowledge with me. I had to be away from development for a day and half to attend to other urgent matters. I am back on the job and going through your feedback. I will post the results as soon as I have

[Rails] ferret not working after upgrade

2008-12-13 Thread Petan Cert
After a recent upgrade to a newer ferret version and acts_as_ferret plugin, searching is not working any more. I have changed find_by_contents to find_with_ferret, but it still doesnt work. :( user.rb acts_as_ferret({:fields = ['username', 'lastname', 'town'}) search form.rhtml % form_tag({

[Rails] how to import a dump .sql file in a rake task

2008-12-13 Thread Erwin
I have a dump of some tables to be filled when the app is setup '.../db/dataset/regions_dpt_cities_codes.sql' I would like to execute a task similar to the mysql source dump_file like : ActiveRecord::Base.connection.execute(source #{path};) (which doesn't run fine, of course is it

[Rails] Re: REST v/s SOAP

2008-12-13 Thread Ryan Bigg
http://en.wikipedia.org/wiki/REST#REST_versus_RPC - Ryan Bigg Freelancer http://frozenplague.net On 14/12/2008, at 1:02 AM, Margareth Florián wrote: Hi, Sijo SOAP and REST are different thinks. SOAP is and envelop protocol like HTTP. REST is a design style for a stateless

[Rails] Re: Updates using urls and query strings

2008-12-13 Thread Frederick Cheung
On Dec 13, 7:32 pm, DAZ daz4...@gmail.com wrote: Thanks for the reply Frederick, I just have two questions: 1) How exactly do I coerce it into a boolean value - is there a best- practice way of doing this? doesn't need to be any more complicated than if params[:foo] == 'true' ... 2) How

[Rails] Re: Bug with assert_select and javascript?

2008-12-13 Thread Phlip
Colin Law wrote: for(var i=0; iboxes.length; i++) Is this a bug in assert_select or am I doing something foolish in my ignorance? Ultimately the fault lies in zillions of web pages written with Notepad. The Law (actually the Recommendations) say thou shalt escape with lt;. But not all

[Rails] Re: Is Rails suitable for highly customized standard software

2008-12-13 Thread Phlip
Andy Meyer wrote: Hello, I am working in a small software company. We are developing business applications for a very niche industry. At the moment our software products are mainly fat client windows applications which are accessing different kinds of database servers. Now we plan to slowly

[Rails] Newbee met problems when do some i18n on rails

2008-12-13 Thread Daniel
1. I have download the zh-CN.yml file from http://github.com/svenfuchs/rails-i18n/tree/master/rails locale 2. I have put this zh-CN.yml in to my locales folder. 3. I have modified the enviorment.rb like follow: config.i18n.load_path Dir[File.join(RAILS_ROOT, 'my', 'locales', '*. {rb,yml}')]

[Rails] HTML in db columns

2008-12-13 Thread Don French
I have some text columns where I would like many of the html commands available. I can insert tags in the field with no problem and it stays there. When I try to use the data like %= @item.description % I loose several of the tags. They do not work. Particularly the ul ol li tags. The b i tags

[Rails] Re: HTML in db columns

2008-12-13 Thread Phlip
Don French wrote: I have some text columns where I would like many of the html commands available. I can insert tags in the field with no problem and it stays there. When I try to use the data like %= @item.description % I loose several of the tags. They do not work. Particularly the ul ol

[Rails] Re: how to import a dump .sql file in a rake task

2008-12-13 Thread Patrick Doyle
On Sat, Dec 13, 2008 at 5:57 PM, Erwin yves_duf...@mac.com wrote: I have a dump of some tables to be filled when the app is setup '.../db/dataset/regions_dpt_cities_codes.sql' I would like to execute a task similar to the mysql source dump_file like :

[Rails] Calling an action within javascript function w/ ajax

2008-12-13 Thread David
I am trying to call an action within a javscript function using ajax, but I am having some problems. I need the ajax call to return a value and am thinking I can do this using onComplete and Ajax.Request but I am running into some problems. This is the code I am using for the Ajax.Request:

[Rails] Re: Calling an action within javascript function w/ ajax

2008-12-13 Thread David
Im thinking this needs to be a 'GET' request in order to return a response, but when I change the method to a GET, it calls the show action: Parameters: {username=f, action=show, id=username, controller=users} Stumped... On Dec 13, 8:01 pm, David dly...@gmail.com wrote: I am trying to call

[Rails] Passing local to template to partial

2008-12-13 Thread Jeffrey L. Taylor
I want to pass an array to a template as a local variable. The template passes the same local variable to a partial as a local variable. This isn't working as I expect and something in the back of my mind is says that I read something about this. Nothing shows up in the first three pages of my

[Rails] Re: Rails 2.2.0 and Gettext incompatible?

2008-12-13 Thread grosser.michael
Masao Mutoh says: work is under way, new gettext will require ruby- locale to run, hopefully we can switch to 2.2 soon :D On Oct 28, 4:59 pm, Stanislav Bozhkov rails-mailing-l...@andreas- s.net wrote: 10x for the explanations. It looks that we should continue developing with the current

[Rails] Re: Rails 2.2.0 and Gettext incompatible?

2008-12-13 Thread grosser.michael
Masao Mutoh says: work is under way, new gettext will require ruby- locale to run, hopefully we can switch to 2.2 soon :D On Oct 28, 4:59 pm, Stanislav Bozhkov rails-mailing-l...@andreas- s.net wrote: 10x for the explanations. It looks that we should continue developing with the current