[Rails] Re: select helper with boolean and null/nil values

2010-11-19 Thread pepe
> > IMHO boolean columns are just a little different because of their very > > nature. > > I don't see the difference.  Where do you see it? > > > Sure, they can be set to be null but I really don't see the > > advantage in it. > > I've run across cases where something was best modeled by SQL-style

[Rails] Re: select helper with boolean and null/nil values

2010-11-19 Thread pepe
> [...]It's perfectly OK to have Boolean columns (or any columns) > be null-capable if the semantics of the data dictate that. Sure. However, in my experience most people make boolean columns null capable "just because" or because it's the default behavior of the DB when defining columns and after

[Rails] Re: select helper with boolean and null/nil values

2010-11-19 Thread pepe
I believe your problems are coming from the fact that you allow something different than true/false in your DB column. If the column is supposed to contain a boolean value, why are you allowing it to contain the null value? A boolean value is either true or false, not null. If I were you I would fo

[Rails] Re: How to count a group of data

2010-11-15 Thread pepe
> > +1 > > Does that mean that you agree that Michael should slap himself on the > forehead? :) > Or  possibly :(  if the reader is Michael. > > Colin First option. :D It also increases the count of slapped foreheads. ;) I haven't tested what Marnen suggested yet, though. I'm sure it will work bu

[Rails] Re: using DB2 with Rails 3

2010-11-15 Thread pepe
This is from 2007 but it might get you started: http://www.ibm.com/developerworks/data/library/techarticle/dm-0705chun/ On Nov 10, 11:44 am, Conor Nugent wrote: > I have developed a rails 3 app and for various reasons I have been > compelled to try using DB2 as the underlying database system. Do

[Rails] Re: could not find activerecord-sqlserver-adapter locally or

2010-11-10 Thread pepe
> Since you use MSSQL all the time perhaps you could answer my next > hurdle.  How do I convert my connection into a dsn?  My connection > string is: > jdbc:jtds:sqlserver://rogue:1433/AALite; Hi there, This is a list I use when setting up a new MSSQL based application. You might need to skip/cha

[Rails] Re: could not find activerecord-sqlserver-adapter locally or

2010-11-10 Thread pepe
> It didn't work for me: > C:\Ruby187>gem install activerecord-sqlserver-adapter > --source=http://gems.rubyonrails.org > ERROR:  Could not find a valid gem 'activerecord-sqlserver-adapter' (>= > 0) in any repository Have you tried simply: gem install activerecord-sqlserver-adapter I am using MSS

[Rails] Re: How to count a group of data

2010-11-10 Thread pepe
+1 On Nov 9, 2:47 pm, Michael Pavling wrote: > On 9 November 2010 19:14, Marnen Laibow-Koser wrote: > > > Do you disagree with my reasoning?  If so, why? > > Not at all... quite the opposite; I've just slapped myself on the > forehead. I can't believe it's never occurred to me to use > transacti

[Rails] Re: Rollback error message

2010-11-08 Thread pepe
that you are raising. Why not just add the error to your memo object errors and then check in your controller if your memo.errors is empty or not? pepe -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, sen

[Rails] Re: Problem with Sqlserver and Rails on a Win XP

2010-11-06 Thread pepe
> I'm now trying to reinstall ruby on my computer, and if that doesn't > work, I'm thinking about throwing it out the window. > > Magnus In a few months I would like to be where Paul is at and pretty much every day of my life I feel like doing what Colin is suggesting.

[Rails] Re: Problem with Sqlserver and Rails on a Win XP

2010-11-04 Thread pepe
On Nov 2, 7:38 am, "Magnus D." wrote: > I'm trying to connect to a SQLServer 2008 database running on localhost, > but I can't seem to get it working. Hi Magnus, I am using MSSQL and like you I had lots of trouble making it work but I finally did get it to work. I am also using XP and here is my

[Rails] Re: Creating an association with accepts_nested_attributes_for

2010-11-03 Thread pepe
Probably a silly question. Have you declared the belongs_to and has_many associations? On Nov 2, 11:08 am, Stuart Corbishley wrote: > I have 2 models, Category and LineItemTypes > > There are already plenty existing of both, it is now a requirement for > them to be associated. Being many LineItem

[Rails] Re: git newbe

2010-10-31 Thread pepe
> Not where you'd get questions answered but potentially > handy:http://help.github.com/git-cheat-sheets/ Thanks. I'm sure this will be handy. -- 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 rubyonra

[Rails] Re: git newbe

2010-10-31 Thread pepe
> This should answer most, if not all, of your questions about Git: > > http://progit.org/book/ Thanks Robert, but not quite. I had already found the URL before your post and although I have to admit I have not read the entirety of the documentation I went through most of the sections I need infor

[Rails] git newbe

2010-10-30 Thread pepe
Hi all, Finally starting with git/versionning and would like to know the best place(s) where to post my questions (many of them). Already signed up at http://vger.kernel.org/vger-lists.html. Thanks in advance. -- You received this message because you are subscribed to the Google Groups "Ruby o

[Rails] Re: JRuby + Windows Service

2010-10-27 Thread pepe
I use Mongrel as web service. Here is a link that might help: http://noobonrails.blogspot.com/2006/06/how-to-setup-mongrel-as-native-windows.html On Oct 26, 10:29 am, Daniel Shimoyama wrote: > Wassup everyone? > > I'm trying to deploy a application on windows server 2000, developed > with JRuby.

[Rails] Re: Automatic validation

2010-10-22 Thread pepe
> > Got it working. Thanks for the tip. It would be great if 'schema.rb' > > got updated with the code for the FK constraints, though. > > That's what Foreigner does.  Is it not working for you? My mistake. I just saw them at the end of the file. Thanks for everything, this is going to help a lot.

[Rails] Re: Automatic validation

2010-10-21 Thread pepe
> Yes, apparently you missed my announcement a couple months ago of my > fork of Foreigner with MS SQL Server > support:http://github.com/marnen/foreigner > The gem is available as marnen-foreigner. Got it working. Thanks for the tip. It would be great if 'schema.rb' got updated with the code for

[Rails] Re: Automatic validation

2010-10-21 Thread pepe
> > you can run a sql command in your migration to generate a foreign key > > constraint yourself, look at activerecord execute > > this should give you an idea: > > http://fdietz.wordpress.com/2008/08/03/migrations-and-foreign-key-han... That's exactly what I did yesterday when I realized Foreign

[Rails] Re: Automatic validation

2010-10-21 Thread pepe
> > Yes, I think you're right and going with Referential Integrity should > > be the way to go to make sure the rules are enforced at the DB level. > > Although, I still would like to know how I can accomplish what I was > > trying to do. > > With foreign key constraints.  There is really no reason

[Rails] Re: Automatic validation

2010-10-20 Thread pepe
> Use foreign key constraints in the database for this. The Foreigner gem > will help manage these constraints. Yes, I think you're right and going with Referential Integrity should be the way to go to make sure the rules are enforced at the DB level. Although, I still would like to know how I ca

[Rails] Automatic validation

2010-10-20 Thread pepe
I want to automate a validation on all (or almost all) my models. That validations should happen before every delete/destroy. The goal is to stop the user from deleting a record if it has any 'has*' associations. I know that there are gems like 'acts_as_paranoid' that will keep the record in the D

[Rails] Re: How to make an ActiveRecord::Base object to have a list of strings?

2010-10-18 Thread pepe
This won't answer your question but I hope it helps you because your approach sounds too complicated to me, unless it is just for playing and learning. Why would you want to store each word in a record in a table? What if a word belongs to more than one paragraph? On Oct 18, 12:46 pm, Gogov wrote

[Rails] Re: is an application for state machine?

2010-10-14 Thread pepe
> Sorry but my english understanding is very bad. Your English is fine for me, at least the written one. > I've to make an application to monitor the installation and > replacement of all the PCs in my company. [...] > Do you think that one type of application of this kind is suitable for > the u

[Rails] Re: params function not working

2010-10-14 Thread pepe
> Anyway, any solution requiring js.erb is, almost by definition, "doing > it all wrong".  js.erb should never be necessary in a well-written > project: you shouldn't be dynamically generating source code. What do you mean by "dynamically generating source code" here? Are you saying that going for

[Rails] Re: Use of Editors(like Radrails,Netbeans) in ROR?

2010-10-13 Thread pepe
> IDEs are often bloated and difficult to use compared to editors.  For > developing with technologies like J2EE, you need the extra power and > features to make your life easier.  For developing with technologies > like Rails, the extra features just get in the way and slow things down. Yes, some

[Rails] Re: How to display validation errors in nested form

2010-10-13 Thread pepe
          @saved = new_doctor.save! > >                 if @saved == true >                         flash[:notice] = "Registration Successful" >                   redirect_to login_path() >                 else >                         render :action => 'new' >  

[Rails] Re: How to display validation errors in nested form

2010-10-13 Thread pepe
I thought he meant he had 2 form tags, one inside of another. On Oct 12, 7:30 pm, binu wrote: > I am pretty sure you have have nested forms:) > > On Oct 12, 5:04 pm, pepe wrote: > > > You can't have a form inside of another one. Maybe I am > > misunderstand

[Rails] Re: Signature pad

2010-10-13 Thread pepe
Thanks to both of you. I don't have yet the hardware on hand but have requested a unit to see if I can play with it. In the meanwhile I looked for info on the internet and found something promising at http://thomasjbradley.ca/lab/signature-pad. Thanks again. -- You received this message because

[Rails] Re: Use of Editors(like Radrails,Netbeans) in ROR?

2010-10-13 Thread pepe
> Likely what happened.  In the context of the discussion as a whole, I > thought you were comparing IDEs and other editors.  Apparently you > weren't.  Sorry for misunderstanding. Same here. > >> And you don't need an IDE for that. [...] > Because there are other tools out there providing equiva

[Rails] Re: Use of Editors(like Radrails,Netbeans) in ROR?

2010-10-12 Thread pepe
> You said you like IDEs because of global search and replace > capabilities; you seemed to be implying that other editors couldn't do > that. To seem to an to actually do are different things. > But you yourself have just admitted that you don't know much about text > editors, so how can you eff

[Rails] Signature pad

2010-10-12 Thread pepe
I need to capture information entered through a signature pad attached to the client. The signature pad will not only capture the signature but will also have a few check boxes. I assume that the check boxes could be transferred to the HTML page if everything else fails but our client wants to capt

[Rails] Re: field_with_errors.

2010-10-12 Thread pepe
> .field_with_errors { >   display: inline; > > } Just tried it and worked as expected. Thanks Marnen. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe

[Rails] Re: Use of Editors(like Radrails,Netbeans) in ROR?

2010-10-12 Thread pepe
> Please don't mislead people about the features of editors. Not trying to. If you read more carefully you'll notice that I didn't even try to mention a single feature of text editors, among other things because I don't really know much about them. I was solely commenting on IDEs capabilities and

[Rails] Re: How to display validation errors in nested form

2010-10-12 Thread pepe
You can't have a form inside of another one. Maybe I am misunderstanding? On Oct 12, 4:22 pm, Dean wrote: > Hi All, > I have a nested form > OUTER FORM for :doctor >  INNER FORM for :user > > I am having problem is displaying the validation errors for both > doctor and user model. Any idea about

[Rails] Re: Use of Editors(like Radrails,Netbeans) in ROR?

2010-10-12 Thread pepe
> i will change a label named "School Name" to "College Name" will I be > able to change it using radrails or i have to go to my app directory and > change it there in the particular file. RadRails or any IDE will allow you to edit the files of your application, so when you say 'using radrails or

[Rails] Re: How old are you?

2010-10-12 Thread pepe
> > Didn't you used to go out with that lady...? What's her name...? Oh > > yes! Elizabeth Taylor? I don't think you're 21! > > I'm working on finding a chick with that name :) Good luck with that one! It would be too funny if you did. :) Almost 45 and (hopefully) keeping counting. -- You recei

[Rails] Re: How old are you?

2010-10-11 Thread pepe
Didn't you used to go out with that lady...? What's her name...? Oh yes! Elizabeth Taylor? I don't think you're 21! On Oct 11, 10:03 am, Richard Burton wrote: > Just curious how old we all are? Not that it really matters but I was > just wondering. > > To get the ball rolling, I'm 21. > -- > Post

[Rails] HoW to add ruby on rails pages in a PHP application

2010-10-09 Thread Pepe Sanchez
Hi all I am using a CMM developed in PHP and I would like to know how ease it is to add RoR pages in this type of project and also how to add RoR functions inside a PHP page. Please advise! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to th

[Rails] Re: Weird error when order by 'when'

2010-10-08 Thread pepe
> Actually, it's a better idea to use quote_column_name instead of literal > quotes.  This way, changing databases won't break your code (MySQL and > SQLite use `` identifier quoting, PostgreSQL uses "" or nothing, MS SQL > uses [], but the quote_column_name method abstracts them all). I didn't kn

[Rails] Re: How to access virtual attributes in the model

2010-10-08 Thread pepe
I might be missing something but it should be as simple as using the name of the method: 'self.foobar' or 'foobar' should return whatever the method returns. On Oct 8, 1:54 am, Christian Fazzini wrote: > I've got an artist form. In this form I've got attributes that do not > exist in the model t

[Rails] Re: Weird error when order by 'when'

2010-10-07 Thread pepe
I believe I ran into something similar once some time ago. I think that if you enclose the column name with quotes it might take it. On Oct 7, 1:23 pm, Leonel *-* wrote: > In my appointments model, I want to order by a column called "when", > which is supposed to house the appointment date. > > S

[Rails] Re: How RoR handles multiple sub-websites under one host?

2010-10-06 Thread pepe
Why don't you install Mongrel and run your RoR apps through it instead of IIS? I've never used IIS but the stories told about it don't paint a pretty picture. Mongrel is very easy to install and you can run it as a Windows service with Automatic start. On Oct 5, 10:29 pm, crab wrote: > Hi Marnen,

[Rails] Re: how to connect to microsoft sql server 6.5

2010-10-06 Thread pepe
8:40 am, pepe wrote: > I only know about SQLServer 2005 and 2008, not 6.5. Anyway, here is a > list of things I had to do to get a project working with 2005 using > Ruby 1.8.6, Rails 2.3.5 and Mongrel as the web server. You might need > to skip/change some of the steps. I hop

[Rails] Re: field_with_errors.

2010-10-05 Thread pepe
> .field_with_errors { >   display: inline; > > } > > That should do the trick. Thanks Marnen. I'll try that. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsu

[Rails] Re: field_with_errors.

2010-10-05 Thread pepe
> > and if I don't want those divs? > > For my education, why would you object to them being there? Something that has bothered me from time to time is that when there are errors the tag takes the whole line and makes the field to end up in the next line, instead of appearing next to its labe

[Rails] Re: how to connect to microsoft sql server 6.5

2010-10-05 Thread pepe
I only know about SQLServer 2005 and 2008, not 6.5. Anyway, here is a list of things I had to do to get a project working with 2005 using Ruby 1.8.6, Rails 2.3.5 and Mongrel as the web server. You might need to skip/change some of the steps. I hope it helps: 1. Install Ruby (1.8.6): http://ww

[Rails] Re: How to write an ActiveRecord conditions containing null?

2010-10-04 Thread pepe
> > This should be so easy to implement that I am not sure why it has not > > already been done. > > Interesting question.  I've never needed this except as part of complex > queries where I'm already writing SQL anyway, but YMMV. It occurred to me while working on my very first RoR gig. I 'inheri

[Rails] Re: How to write an ActiveRecord conditions containing null?

2010-10-04 Thread pepe
> Found a bug/workaround/fix. Not sure which. > > conditions = {:org => ["ABC", "XYZ", "NULL"]} > Defect.count :conditions => conditions Just ran a quick test on a table of mine with 7 records (6 with the same value in the column being searched and one record with a value of null in it) and your c

[Rails] Re: How to write an ActiveRecord conditions containing null?

2010-10-04 Thread pepe
SQL does not use the equality comparison for null values, it uses 'IS NULL' instead. Convenient, isn't it? ;) Apparently Rails' magic does not go as far as to check if the NIL value is one of the values in the array to generate the correct SQL statement so I think you'll have to do it yourself and

[Rails] Re: Rails2/Rails3 nested form, fields_for not displayed

2010-10-04 Thread pepe
Not used Rails 3 yet, but shouldn't your symbol be plural (:authors) since you have a one-to-many relationship? On Oct 4, 12:39 am, Nicolas wrote: > Hi all, > > I'm having some issues to create a nested form with Rails3, the fields > for creating my "children" object are not displayed in the form

[Rails] Re: need a way to use sort_by with possible nil values

2010-10-01 Thread pepe
You could use 'accepts_nested_attributes_for' in your parent model: accepts_nested_attributes_for :children_models, :allow_destroy => true, :reject_if => proc {|attributes| attributes['your_attribute'].blank?} The 'reject_if' is what does the trick. On Oct 1, 2:19 am, Bob Smith wrote: >

[Rails] Re: Very basic question

2010-09-28 Thread pepe
On Sep 27, 5:10 pm, SW Engineer wrote: > Thanks @Fred. > > Now, I'm getting it better. > > The last thing is, will the value be passed as a parameter to [:x] when > creating a new object? > -- > Posted viahttp://www.ruby-forum.com/. This is both Rails basics and Ruby basics. 'params' is a hash an

[Rails] Re: Add line break to custom error message

2010-09-27 Thread pepe
Thanks Jim On Sep 27, 3:29 pm, Jim Burgess wrote: > pepe wrote: > > If you do, please post the solution. I would like to know. > > Hi Pepe, > > so, after a week of trying I finally found the solution and am posting > it here in case it helps anyone else. &g

[Rails] Re: I cant' use Netbenas to develop ruby

2010-09-24 Thread pepe
This problem should have nothing to do with Netbeans. I have been using Netbeans for a long time and still get that error sometimes. It's always my fault, not Netbeans's. ;) It might be that your DB configuration is not setup correctly or that you have a typo in your URL, or... I would check firs

[Rails] Re: Add line break to custom error message

2010-09-21 Thread pepe
I have not been able to find a way of breaking the line, except by breaking the message in 2 separate ones as I explained before. If you do, please post the solution. I would like to know. Sorry I couldn't be of much help. On Sep 21, 5:52 pm, Jim Burgess wrote: > > First line<%= sanitize('') -%>S

[Rails] Re: Add line break to custom error message

2010-09-21 Thread pepe
> I tried: > > errors.add(:thesis, "This field is too long. <%= sanitize('') -%> > You are using #{field.length} characters out of a permitted > #{permitted}.") > > This produced: > "This field is way too long. <%= sanitize('') -%> You are using > 12600 characters out of a permitted 1000." > > In t

[Rails] Re: Add line break to custom error message

2010-09-21 Thread pepe
Adding this to a regular page broke the string in 2 lines on the page: First line<%= sanitize('') -%>Second line It's not the same thing but it might work? > The source reads: > > This field is too long. & l t ; br /& g t ;You are using 12600 > characters out of a permitted 1000. > > (I have put

[Rails] Re: sortable_element and new ul

2010-09-21 Thread pepe
Sorry, not to make One a dropable element but to be able to receive dropable elements. On Sep 21, 3:34 pm, Pål Bergström wrote: > pepe wrote: > > Not sure what you are asking, but maybe you could check into RJS and > > 'insert_html'? > > > One > Two > Th

[Rails] Re: sortable_element and new ul

2010-09-21 Thread pepe
tags are going to be missing. If I were in your position I would see if I can write some Javascript that inserts the tags around your element if they are not already there when the element is dropped. I'm sorry I can't be of much help. On Sep 21, 3:34 pm, Pål Bergström wrote: > p

[Rails] Re: sortable_element and new ul

2010-09-21 Thread pepe
Not sure what you are asking, but maybe you could check into RJS and 'insert_html'? On Sep 21, 1:10 am, Pål Bergström wrote: > I have a sortable_element, as a tree. I works great to add and remove > from an existing sub list.  But how do you create a new list under one > element that doesn't have

[Rails] Re: Add line break to custom error message

2010-09-21 Thread pepe
Never tried it, but I am thinking your first option should work if you sanitize the whole ''. As you posted it, it might be getting processed and made useless by Rails. Have you checked the source to see what was the HTML output? On Sep 21, 2:57 am, Jim Burgess wrote: > Is it possible to add a li

[Rails] Re: Numericality validation strips chars from original entry

2010-09-19 Thread pepe
; of the problem. In other words, the model should be able to manage itself and take care of the problem. The controller shouldn't need to be involved. On Sep 19, 1:29 pm, jdc wrote: > I'll give that a try.  I was hoping for something less "manual" but I > can live

[Rails] Re: Performing nested queries in rails

2010-09-18 Thread pepe
> [...] Hence I am trying to apply the where condition on > @restaurants, using �...@restaurants = @restaurants.where("cuisine > like ?", params[:cuisine]). But that doesn't work. Once you've gotten @restaurants you are not querying the DB anymore, hence the 'where' should give you an error. @rest

[Rails] Re: rails connection sqlserver 2005 there some wrong!!

2010-09-15 Thread pepe
Here is a series of steps that I had to go through in order to get SQLServer 2005 working for my needs. You might need to skip/replace some steps. I hope this helps you. 1. Install Ruby (1.8.6): http://www.ruby-lang.org/en/downloads/ 2. Install rubygems: a. http://rubygems.org/pages

[Rails] Re: Numericality validation strips chars from original entry

2010-09-15 Thread pepe
Just off the top of my head and never done it but... could you reuse the params value to repopulate the field if the field has errors? I think it should be possible. Something like: unless @your_object.save @your_object.your_attribute = params[:your_object][:your_attribute] if @your_object.error

[Rails] Re: How to disable a select?

2010-09-14 Thread pepe
> <%= f.select :attr, >                     @choices, >                     {}, >                     :include_blank => true, >                     :disabled => !...@condition %> It just happens that I'm working on the very same thing again and the problem with the above is that when the select is

[Rails] Re: How to disable a select?

2010-09-14 Thread pepe
>    f.select :attr, @choices, :include_blank => true, >   :disabled => !...@condition >    f.select :attr, @choices, {:include_blank => true}, >   :disabled => !...@condition >    f.select :attr, @choices, {:include_blank => true}, >   {:disabled => !...@condition} I remember struggling with this

[Rails] Re: "belongs_to" two different people

2010-09-12 Thread pepe
Not exactly the same thing but I think you can relate. In an application I am working on right now I have 2 separate tables, one for Roles (manager, worker, etc) and another one for Users (people). I chose that design instead of keeping a list of roles in the code because it keeps my application '

[Rails] Re: Triggering Javascript from a Ruby form

2010-09-04 Thread pepe
I think one of the things you might need is a 'timer', which will let your code 'sleep' before calling again your 'how_finished' function. I have never done this but remember reading about it, I googled for 'javascript sleep timer' and one of the links I found was this: http://www.daniweb.com/forum

[Rails] Re: Using ActiveRecord Find with associations

2010-09-04 Thread pepe
As I am sure you know the 'find_by*' methods are all dynamic. They are based on the field/column name, not on the type of object the column is supposed to reference (if any). AR will do the magic of finding the ID value if you pass an object to the method but apparently it will not be "magic enough

[Rails] Re: Validates numericality issue

2010-09-02 Thread pepe
> Can you go into more detail on how to do this? I'm new to Ruby on Rails. > > I would do this in the model, after validations. I would use 'each' or > > 'valid?', depending on how you want to handle it. Saving a record goes through a series of steps in Rails and at each one of them you can write

[Rails] Re: Validates numericality issue

2010-09-01 Thread pepe
> Another question... if I want to set a field blank for each field that > had an error how would i do that? I would do this in the model, after validations. I would use 'each' or 'valid?', depending on how you want to handle it. If you clear the field in the model, after validations have run (an

[Rails] Re: Looking for a place to post an add

2010-08-28 Thread Pepe Sanchez
Thank you Bill, I guest I can reformulate my question asking about what url in the web will you browse to look for a job to redesign/recreate a web site. Other than craigslist.org that has a section "gigs","computers" for this kind small projects. I already have a detailed scope of the project

[Rails] Looking for a place to post an add

2010-08-28 Thread Pepe Sanchez
Hi all We need to have a parent's association web site redesigned and rebuilt, amy be using RoR or may be using a CMS. What places do you recommend to an add? Please advise jsn -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Grou

[Rails] Re: Authlogic: activating inactive account/user

2010-08-26 Thread pepe
user as inactive and ends the process, redirecting the user to the login screen. On Aug 26, 5:13 pm, IAmNan wrote: > Did you try resetting failed_login_count to 0? > > d. > > On Aug 26, 11:30 am, pepe wrote: > > > Hello, > > > I have searched high and low on

[Rails] Re: Authlogic: activating inactive account/user

2010-08-26 Thread pepe
user as inactive and ends the process, redirecting the user to the login screen. On Aug 26, 5:13 pm, IAmNan wrote: > Did you try resetting failed_login_count to 0? > > d. > > On Aug 26, 11:30 am, pepe wrote: > > > Hello, > > > I have searched high and low on

[Rails] Authlogic: activating inactive account/user

2010-08-26 Thread pepe
Hello, I have searched high and low on how to activate an inactive account in Authlogic and I can't seem to figure it out. I am using "consecutive_failed_logins_limit" to control a brute force attack and I want to offer a function so a 'manager' can enable the inactive account and bypass the numb

[Rails] Re: Rails 3: Error saving an object with no useful information

2010-08-24 Thread pepe
I know it's silly but have you checked the log file(s)? If you are working with the console in development mode it should give you all information you might need to debug the problem. Thinking about the problem a little more makes me believe that you probably have code that looks like this: u = U

[Rails] Re: Rails 3: Error saving an object with no useful information

2010-08-23 Thread pepe
Sorry, I didn't pay too much attention to the subject. My apps run under 2.3.5 and that might make things different, though. On Aug 23, 3:32 am, Heinz Strunk wrote: > No one? I'm kinda desperate with that problem... > -- > Posted viahttp://www.ruby-forum.com/. -- You received this message becau

[Rails] Re: Rails 3: Error saving an object with no useful information

2010-08-23 Thread pepe
Are you working from irb or the console? It seems that you are running your code from irb (irb(main):054:0> reload!;User.last.save!) and you might not have everything you need loaded. I just tried User.last.save! from the console on one of my apps and it works just fine. On Aug 23, 3:32 am, Heinz

[Rails] Re: How to disable button generated by submit_to_remote?

2010-08-22 Thread pepe
These 2 versions will disable the button: <%= submit_to_remote "add", "Add", :url => { :action => "add_groups" }, :html => {:update => 'divgrouptable', :disabled => true} %> <%= submit_to_remote "add", "Add", :url => { :action => "add_groups" }, :update => 'divgrouptable', :html => {:disabled => t

[Rails] Re: Trying to use AJAX to delete a new record

2010-08-16 Thread pepe
Take a look at Railscasts #197, I think it might help you find a solution to your problem. On Aug 15, 5:46 pm, Bob Smith wrote: > Bill Walton wrote: > > Hi Bob, > > > On Sun, Aug 15, 2010 at 12:26 AM, Bob Smith > > wrote: > >> I have some AJAX in my app which works fine to add new people to a li

[Rails] Re: How to test routes urls in console

2010-08-13 Thread pepe
rsion .. Rails 3 > thanks for this link ,I'll keep it in a safe place > > On 12 août, 16:31, pepe wrote: > > > A quick Google search would have yielded > > this:http://blog.zobie.com/2008/11/testing-routes-in-rails/ > > > AWDWR also has a pretty good section

[Rails] Re: How to test routes urls in console

2010-08-12 Thread pepe
A quick Google search would have yielded this: http://blog.zobie.com/2008/11/testing-routes-in-rails/ AWDWR also has a pretty good section on how to test routes. On Aug 12, 3:14 am, Erwin wrote: > I tried require 'url_writer' > but this is not the trick > > what should be required/included to te

[Rails] Re: Problem with named_scope using a count

2010-07-28 Thread pepe
> That's pretty much what I had in mind for stashing.  There is some > merit to still having a separate Rate model, storing *who* rated each > Post as good or bad (and maybe when?), to prevent ballot-stuffing and > let them change it later.  However, I would be tempted to call it > Rating, since th

[Rails] Re: Problem with named_scope using a count

2010-07-27 Thread pepe
Maybe adding 2 integer columns to your Posts table to count the hits? When somebody rates the Post you just add 1 to whichever column you need. Then it would be a simple matter of sorting your posts in ascending/descending sequence by the column you want to work with. I would add indexes by the c

[Rails] Re: Association record duplication

2010-07-23 Thread pepe
On Jul 22, 5:22 am, pepe wrote: > [...] I finally discovered (from a > simpler use of fields_for that I have working) that fields_for > generates actually 2 input tags for each one of the association > records, one for the field you need and another one that is a hidden > fiel

[Rails] Re: Association record duplication

2010-07-22 Thread pepe
ke my sorting work, and it did. On Jul 21, 3:42 pm, Colin Law wrote: > On 21 July 2010 01:10, pepe wrote: > > > > > I have an edit page that generates a few input fields I organized in a > > table, like so: > >       > >        Driv

[Rails] SOLVED: Association record duplication

2010-07-21 Thread pepe
Never mind. Got it working. I should pay more attention to the documentation. Sorry to waste your time. On Jul 20, 8:10 pm, pepe wrote: > I have an edit page that generates a few input fields I organized in a > table, like so: >       >         Driver License >        

[Rails] Association record duplication

2010-07-20 Thread pepe
I have an edit page that generates a few input fields I organized in a table, like so: Driver License Passport SSN The same fields work great i

[Rails] Re: How to update user model attributes and bypass a presence_of validation?

2010-07-19 Thread pepe
Validations usually have an :if/:unless option. That might be helpful. You could, for example, condition the password and e-mail values to validate only if the name is present. On Jul 19, 2:33 pm, Andrew Perkins wrote: > Hello, I have a user model which stores a users name, email, and password. >

[Rails] Re: Ruby - return true if any element in Array satisfies condition but false otherwise

2010-07-19 Thread pepe
Array includes module Enumerable. 'any?' can be found in Enumerable. On Jul 19, 2:13 am, Ram wrote: > Perfect! :) thanks! Couldn't find docs on this though. > > On Jul 16, 7:07 pm, Frederick Cheung > wrote: > > > On Jul 16, 1:48 pm, Ram wrote: > > > > Hi, > > > > ARubyquestion. > > > > Anyone k

[Rails] Re: SOAP web service

2010-07-17 Thread pepe
Thank you. On Jul 13, 10:18 am, codefusurfer wrote: > Thanks Pepe, > >  I am in the process of recoding ActionWebService to support Document > Literal. So far I recoded the WSDL to produce document / literal. I > will be recoding the SOAP message decode/encode and request/re

[Rails] Re: SOAP web service

2010-07-08 Thread pepe
Try this: http://github.com/datanoise/actionwebservice I believe they took the original Rails actionwebservice product and they are keeping at it. I had to work with web services (consuming them, not providing them) and had lots of problems with the original Rails version. I still had some problem

[Rails] validates* inside method

2010-06-30 Thread pepe
Is there a way of using the 'validates*' methods inside another method? For instance, I need to make sure a field is empty under a certain set of circumstances and contain data under a different set of circumstances. I would like to keep all the logic in one place and have the benefits of what Rail

[Rails] Re: Mongrel is Terminating Automatically

2010-06-30 Thread pepe
If you google for 'segmentation fault' you'll get many hits on the topic. I have read a couple of them and they seem to be related to memory problems with the garbage collection mechanism or with hardware that is not able to perform the requested operations. I don't know if this is the case but ma

[Rails] Re: Editing multiples rows in a single table

2010-06-29 Thread pepe
Check out some of the railscasts episodes (http://railscasts.com). Search for 'multiple' and you might find something of interest to you. On Jun 28, 2:23 pm, richardsugg wrote: > I have a table that contains user options, so the table looks like > id > username > option_name > option_value > > Ho

[Rails] Re: Stopping enter from submitting a form

2010-06-17 Thread pepe
I just read this up in a JS book. The submit button has actually 2 events happening sequentially. The first one is an onClick and the second one an onSubmit. Both can return false and stop the execution of the action. If onClick returns false onSubmit will not be executed. I guess you could control

[Rails] Re: Allow blank on should validate_uniqueness_of

2010-06-17 Thread pepe
On Jun 17, 1:28 am, J. Pablo Fernández wrote: > Where do you pass that? > > should validate_uniqueness_of(:email, :allow_blank => true) > > That doesn't work. That method takes only one argument: group/rubyonrails-talk?hl=en. > > -- > J. Pablo Fernández (http://pupeno.com) Here is a link to the

<    1   2   3   4   5   >