[Rails] Re: An article: interest in rails is waning

2017-07-27 Thread Michael Pavling
On Thu, Jul 27, 2017 at 8:10 PM, DHH > > wrote: > >> That article is a joke. Of course Rails training is not as much in demand >> as it was when it was brand new and nobody knew how to work with it. But to >> think that the change in that has anything to do with the rise of >> J2EE/Spring?! C

[Rails] Time to flounce...

2012-09-13 Thread Michael Pavling
Well, it's been a lovely few (four, I think?) years on the RailsTalk list, but I'm unsubscribing now (and I didn't want to just fade out the side-doors like so many names before). I'm still working with Rails (and will continue to while the contracts are around), but I can't take the volume and qu

Re: [Rails] Re: 15min of mentorship asked

2012-09-11 Thread Michael Pavling
On 11 Sep 2012 13:59, "Pj M." wrote: > > Hi there, > > I'm operating on a windows machine. > However the kind of advice I'm looking for is not so technical in nature > that I need advice how to get RoR running on my machine. > > With the help of AWDWR I already built the depot app on my machine. N

Re: [Rails] Object Efficiency

2012-09-09 Thread Michael Pavling
On 10 September 2012 05:03, rails2012 wrote: > In my rufus config file, I have to call MyController.new.checkEmail. Now I > set it to run every 5 minutes. So the system creates a new MyController > instance every 5 minutes. That's very inefficient right? Normally it would be worth worrying abo

Re: [Rails] misleading variable value

2012-09-09 Thread Michael Pavling
On 10 September 2012 02:41, John Merlino wrote: > I'm going to invoke action view base from console, passing a string > object: > > 1.9.3p0 :016 > ActionView::Base.new('app/views') > > Look at the return value assigned to @view_paths. It should not be an > array. It should be a PathSet object inst

Re: [Rails] Math between Models

2012-09-04 Thread Michael Pavling
On 4 September 2012 18:58, Sachin S. wrote: > Class Model_1 < ActiveRecord::Base > ... > has_and_belongs_to_many :model_2 > > def some_method > attr_1 * Model_2.find(model_2_id).attr_I_need > end If the relationship is HABTM, you won't have a model_2_id attribute to find by, there should be a

Re: [Rails] Is it a good idea for me to learn Ruby on Rails?

2012-09-01 Thread Michael Pavling
On 30 August 2012 13:33, Peter Hickman wrote: > For someone who says that they have "very little programing knowlege" > you seem to have your mind already made up. Why did you even come here > and ask your question if you already know the answer? > > So young, so set in your ways. Very sad. http:

Re: [Rails] Re: Re: Extracting information out of a database column

2012-08-31 Thread Michael Pavling
On 31 August 2012 08:59, Joshua Baldock wrote: > Message column and example message looks like this: > > "The [user] is logged in via [hostname]" I assume the square brackets are not in the string, so that a real string might look like : "The administrator is logged in via michael-desktop" ? I

Re: [Rails] Re: Extracting information out of a database column

2012-08-31 Thread Michael Pavling
On 31 August 2012 08:20, Joshua Baldock wrote: > Splitting the string and then storing them as additional attributes to > the instance variable that contains the rest of the selected table > values. Do you have an example of the string; the pattern that similar instances would follow, and the com

Re: [Rails] Extracting information out of a database column

2012-08-31 Thread Michael Pavling
On 31 August 2012 07:41, Joshua Baldock wrote: > I have an existing database that im building a rails app on top of. One > of my columns 'message' is a long string that I would like to be able to > query and split into various attributes to then be able to display each > of those attributes in a v

Re: [Rails] Ensure that only one member of a collection has the "current" flag set

2012-08-29 Thread Michael Pavling
On 29 August 2012 16:13, Walter Lee Davis wrote: > I have a model that includes a :current boolean. The idea is that there are > many home pages that the admin is working on at any given time, but only one > is current at a time. At the moment, I have enforced this with the following: > > before

Re: [Rails] Re: A Ruby Book (free to use)

2012-08-28 Thread Michael Pavling
On 28 August 2012 08:32, Karthikeyan A k wrote: > LOL! All know its absurd, don't u ppl have a sense of humour or > something? Is it supposed to be a joke book, or a tutorial? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to t

Re: [Rails] Where to store functions

2012-08-25 Thread Michael Pavling
On 25 August 2012 18:40, Dave Castellano wrote: > "Generated" questions are generated by a "method" I write. When a > generated question is picked, the method I wrote is called and it > returns an "instance" of the question, its correct answer, and its > explanation. Each time the question is ca

[Rails] Quick Poll - Searching

2012-08-22 Thread Michael Pavling
What do you go for (for a Rails 2.x app...)? SearchLogic, or a little "scopes" plugin? I'm wondering whether I might just as easily get all my dynamic searching done with TrixyScopes [1], or just plump for the market leader. [1] http://rubygems.org/gems/trixy_scopes -- You received this messa

Re: [Rails] Re: How can I copy records from one table to another?

2012-08-14 Thread Michael Pavling
On 14 August 2012 11:12, Andrew Vit wrote: > acts_as_paranoid simply adds a deleted_at flag, it doesn't move records to a > separate table. It does a *little more* than simply that... > Something like acts_as_archive is a better equivalent. The requirement to move them to another table was beca

Re: [Rails] Re: How can I copy records from one table to another?

2012-08-14 Thread Michael Pavling
On 14 Aug 2012 04:38, "ZeroModulus" wrote: > > The number of records would vary widely. > > I thought of doing deleted tables because I had already thought of having an attribute to mark a record as active, but figured I would have to write an exclusion clause every time. > > Would there be a way

Re: [Rails] Pop quiz: Where do you watch for job postings?

2012-08-09 Thread Michael Pavling
On 9 August 2012 16:04, Ed W wrote: > Hi all, I'm looking for some advice on where we should be putting an advert > if we are looking to hire a full time rails developer? Or turning it around > what websites (or mailing lists) do folks here use to if they feel the need > for a change in view from

Re: [Rails] Where to store array(hash)?

2012-08-09 Thread Michael Pavling
On 5 August 2012 20:12, Дмитрий Снегирев wrote: > I have hash: > > {"default_list" => { > "ws" => 15, > "ret"=> 50}, > "ret_discount" => { > 5 => 5000, > 10=>1, > 15=>15000, > 20=>3 }} > > Where better to keep it? Without database. In

Re: [Rails] How to encrypt Ruby script..

2012-08-07 Thread Michael Pavling
On 7 August 2012 11:46, Shrikant Lokhande wrote: > Yes its cool,,, but i want to run one ruby script and script having > confidential info. > So i need run that in encrypted mode. Drip-feeding information like this is very frustrating. http://www.catb.org/esr/faqs/smart-questions.html (tl/dr:

Re: [Rails] How to encrypt Ruby script..

2012-08-07 Thread Michael Pavling
On 7 August 2012 11:36, Shrikant Lokhande wrote: > Its encripted but its not running.. Why would it run? It's no longer a Ruby file, it's *encrypted*! -- 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

Re: [Rails] Rspec

2012-08-04 Thread Michael Pavling
On 4 August 2012 06:30, honey ruby wrote: > Hi all i'm trying to learn Rspec testing can anyone suggest me the best > book to learn Rspec with good sample code. "The RSpec Book", maybe? http://www.google.co.uk/search?q=rspec+book Is your Google broken... -- You received this message because

Re: [Rails] Polymorphic one-to-one associations in Rails 3.2 - what's the "correct" Rails way?

2012-08-03 Thread Michael Pavling
On 1 August 2012 02:17, Neil Mowbray wrote: > Unless I'm being dumb I cannot find anything on Google search or in the > Rails books on how to create a one-to-one polymorphic association > (as apposed to a one-to-many polymorphic association). Change the has_many to a has_one, and you should have

Re: [Rails] Testing Rails app

2012-08-03 Thread Michael Pavling
On 3 August 2012 06:32, honey ruby wrote: > Hi everyone i want to test a rails app and i have no idea on testing the > rails app. Can any guide me how to test a rails app and what are the best > way to test an app. Have you tried http://www.google.co.uk/search?q=test+rails+app Imagine that each

Re: [Rails] How to remove a record if it is duplicate end sum values :val

2012-08-03 Thread Michael Pavling
On 1 August 2012 14:25, Esmerino Costa wrote: > I have a hash like so: That's not a hash, it's an array of hashes. > What I would like to learn how to do is how to remove a record if it is > duplicate end sum values :val. list.uniq! -- You received this message because you are subscribed to

Re: [Rails] Integration of barcode Scanner or Reader into Application

2012-07-31 Thread Michael Pavling
On 31 July 2012 08:13, saritha chakilala wrote: > Can any one help how to integrate barcode reader into my Application. > > What I want actually is that, >By Capturing the value of barcode(registrtion_id) all other fields of > that particular record need to autofill. > > ***I Am Looking For Yo

Re: [Rails] update_attributes clears password

2012-07-30 Thread Michael Pavling
On 30 July 2012 22:39, jsnark wrote: > I understand the problem now, but I do not see the solution. The model has > a before_save filter that is causing the password to be reset. How do I > stop this on an update? The same way I said before - only run it if the password has been populated:

Re: [Rails] update_attributes clears password

2012-07-30 Thread Michael Pavling
On 30 July 2012 20:23, jsnark wrote: > The hash does not contain a password key/value pair. In spite of this, the > password is set to the empty string. What filters run in the model? What observers are operating? It would be worth setting a breakpoint at your update_attribute line and following

Re: [Rails] update_attributes clears password

2012-07-30 Thread Michael Pavling
On 30 Jul 2012 18:14, "jsnark" wrote: > > I have a database table that contains encrypted passwords along with other information relating to users. When I do an update_attributes operation on a row in the table with a hash that does not contain a password, the password gets reset to the empty str

Re: [Rails] Same name action and attribute in a model

2012-07-27 Thread Michael Pavling
On 27 July 2012 17:31, sumit srivastava wrote: > Right now I have renamed it to passwordtext but originally it was password. > I wrote about its behavior when named as password. Okay... so what help is that? What difference does what something *used* to be make?! If you have a problem *now* it's

Re: [Rails] Same name action and attribute in a model

2012-07-27 Thread Michael Pavling
On 27 July 2012 11:52, sumit srivastava wrote: > That might be another solution. But what I am trying to know is why isn't > this method working. And how is the action def password=(pass) actually > being called. Because I didn't see any exclusive line where it is being > called. My analysis says

Re: [Rails] Same name action and attribute in a model

2012-07-27 Thread Michael Pavling
On 27 July 2012 11:37, sumit srivastava wrote: > This is what I receive, > > SystemStackError (stack level too deep): > app/models/user.rb:26:in `password=' > app/models/user.rb:27:in `password=' > app/controllers/user_controller.rb:31:in `new' > app/controllers/user_controller.rb:31:in `c

Re: [Rails] Same name action and attribute in a model

2012-07-27 Thread Michael Pavling
On 27 July 2012 11:13, sumit srivastava wrote: > During customizations I have used password as the column where encrypted > password shall be saved. So I created my own attr_accessor, i.e., > passwordtext. I have named the password_field_tag in my form as > passwordtext. But when I do so, it is no

Re: [Rails] Same name action and attribute in a model

2012-07-27 Thread Michael Pavling
On 27 July 2012 10:42, sumit srivastava wrote: > This is the complete model. I am trying to encrypt the password. >> def self.hashedpass(login, pass) >> u=find(:first, :conditions=>["login = ?", login]) >> return nil if u.nil? >> return u if User.encrypt(pass, u.salt)==u.hashed_passw

Re: [Rails] Same name action and attribute in a model

2012-07-27 Thread Michael Pavling
On 27 July 2012 08:07, Michael Pavling wrote: > Which (if any) of those lines is line 26 in your UserController? What > does the User.encrypt method look like? Ignore me... I can't even read your error message properly myself. >> I used the following action to enc

Re: [Rails] Same name action and attribute in a model

2012-07-27 Thread Michael Pavling
On 27 July 2012 07:22, Sumit Srivastava wrote: > I have been following following tutorial to make a user login session. > http://www.aidanf.net/rails_user_authentication_tutorial > > I used the following action to encrypt the password. >> >> def password >> #debugger >> @password1=pass

Re: [Rails] Re: Rails' inflections are messy

2012-07-19 Thread Michael Pavling
On 19 July 2012 20:48, Colin Law wrote: > On 19 July 2012 20:07, Linus Pettersson wrote: >> At least they should fix the ones that are incorrect... >> >> "Octopus".pluralize should return "Octopuses" and NOT "Octopi"... :) > > But then all those applications that rely on the current pluralisation

Re: [Rails] Nil Class

2012-07-16 Thread Michael Pavling
On 16 July 2012 20:52, Adnan wrote: > I've a field in my two db tables called "username". when I try to match post > author and current username for editing a post > @movies.username==current.name in my moviescontroller. It showed nil class > or method. Why this is showing??Any ideas?? Check what

Re: [Rails] error in runtime controller#view

2012-07-04 Thread Michael Pavling
On 4 July 2012 07:14, Abhishek Sharma wrote: > class PageController < ApplicationController > > before_filter :find_subject > > def new > @page = Page.new(:subject_id => @subject.id) > @page_count = @subject.pages.size + 1 > @subjects = Subject.order('position ASC') > end > >

Re: [Rails] Re: variable symbol

2012-07-03 Thread Michael Pavling
On 3 July 2012 13:04, Aleksey V Zapparov wrote: > I don't speak Deutsch, but I guess I understood you. Sorry it was my > mistake (copy-paste is evil): > > us.bslnk.send :"#{tst}=" false You're probably going to need a comma in there to separate the parameters being passed to .send us.bslnk.sen

Re: [Rails] E-Books for RoR 3

2012-06-27 Thread Michael Pavling
On 27 June 2012 12:12, Ankit Kipl wrote: WHAT ARE YOU DOING SENDING 12Meg FILES TO THIS LIST? Not to mention that it's copyright material... Ryan may be in contact with your ISP shortly -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" grou

Re: [Rails] will_change!

2012-06-27 Thread Michael Pavling
On 27 June 2012 10:56, kengsreng tang wrote: > Dear all > model person >  id: 1, >  name: "test" > end > i need some explanation about name_will_change! you're not the only one. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to

Re: [Rails] Unit Testing SQL

2012-06-22 Thread Michael Pavling
On 22 June 2012 15:07, Gurdipe Dosanjh wrote: > What is the best way to unit test hard coded sql in a rails application. You don't test SQL, you test methods. Whether the method gets it's results through ActiveRecord, raw SQL, or fairies rummaging around the hard drive, it's irrelevant to the tes

Re: [Rails] Re: Associations join

2012-06-20 Thread Michael Pavling
On 20 June 2012 08:51, Timen E. wrote: > #card_controller.rb > class CardController < ApplicationController >  def show >    @card = Card.all >  end > end > > Card#show > Find me in app/views/card/show.html.erb > <%= @card.user %> > > undefined method `user' for # > Extracted source (around line #

Re: [Rails] Re: why use rescue nil?

2012-06-20 Thread Michael Pavling
On 20 June 2012 01:55, John Merlino wrote: > ok I thought it would return nil It would take 30seconds to try it out in a console... -- 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@go

Re: [Rails] I can't install ruby on rails on my mac - Sorry I know it's been posted 1 million times before

2012-06-13 Thread Michael Pavling
If it's been posted a million times before, have you read all the responses to those questions?... On 13 June 2012 11:33, blakeh92 wrote: > This is the guide i've been following: > > http://hivelogic.com/articles/ruby_rails_lighttpd_mysql_tiger/ You're following a 7-year-old thread guide?! Can y

Re: [Rails] how to update a table which is connected with joins

2012-06-13 Thread Michael Pavling
On 13 June 2012 10:20, hanish jadala wrote: > hi Michael Pavling i can not change my > relationship because i have used in many other places if i change > relationship i have to make more changes in my app that is y i can not > change my relationship. So instead of doing a refacto

Re: [Rails] how to update a table which is connected with joins

2012-06-13 Thread Michael Pavling
On 13 June 2012 08:31, hanish jadala wrote: > hi all help me out guys > > > thanks in advance > > On Tue, Jun 12, 2012 at 3:07 PM, hanish jadala > wrote: >> >> no with our changing the relationship can i update values. We did - you refused to do it :-/ Let's just restate your position: You wan

Re: [Rails] how to update a table which is connected with joins

2012-06-12 Thread Michael Pavling
On 12 June 2012 10:31, honey ruby wrote: > > hi all there are two tables Student and Batch in there model i have > has_and_belongs_to_many :graduated_batches, :class_name => 'Batch', > :join_table => 'batch_students' in Student table > i have added a new column to batch_students table and i want t

Re: [Rails] installing ruby on rails 1.9.3 on windows 7

2012-06-11 Thread Michael Pavling
On 11 June 2012 19:19, nishant g. wrote: > C:\Sites\railsinstaller_demo>rails s > C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/execjs-1.4.0/lib/execjs/run > times.rb:51:in `autodetect': Could not find a JavaScript runtime. See > https://gi > thub.com/sstephenson/execjs for a list of availa

Re: [Rails] Re: if else statement

2012-06-11 Thread Michael Pavling
On 11 June 2012 10:19, Paul McGuane wrote: > thanks for the tips, i cleaned up the code a bit, and used some other > logic which produced this > > def win_lose_tie >    if self.for.to_i == self.against.to_i then >      :tie >    elsif self.for.to_i > self.against.to_i then >      :win >    else >

Re: [Rails] Re: if else statement

2012-06-10 Thread Michael Pavling
On 10 June 2012 01:12, Paul McGuane wrote: > Hi  Michael, > I have tried the code you suggested, though all i seem to get is every > result as a tie. this is what I have in my > > #model > def win_lose_tie >    return :tie >    if if schedule.for.to_i == schedule.against.to_i >         schedule.fo

Re: [Rails] Modeling one way associations

2012-06-09 Thread Michael Pavling
On 9 June 2012 17:51, Colin Law wrote: > @Michael, perhaps we should work in shifts. > > Colin :-D -- 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 fr

Re: [Rails] if else statement

2012-06-09 Thread Michael Pavling
On 9 June 2012 17:26, Paul McGuane wrote: > undefined method `>' for nil:NilClass > Extracted source (around line #47): The error is telling you that the thing you are calling "greater than" on is nil. Looking at line 47, that thing is "schedule.for" - this value, although you *think* it may be a

Re: [Rails] Modeling one way associations

2012-06-09 Thread Michael Pavling
On 9 June 2012 16:45, Jason Walsh wrote: > I am working on a project where I have a Process object that references > a Node object.  I have tried adding a node_id column in the Process > table and created an has_one relationship in the Process model. Change that relationship definition to a belon

Re: [Rails] Re: Problem with array of hashes

2012-06-05 Thread Michael Pavling
On 5 June 2012 19:19, cyber c. wrote: > Yah i get it. I wanted to convert this array of hash into an array of > class objects. How do i do that in ruby? They are "class objects" - hashes are instances of Hash class ... -- You received this message because you are subscribed to the Google Groups

Re: [Rails] Re: validation not called on create, only update

2012-06-01 Thread Michael Pavling
On 1 June 2012 04:31, flaps wrote: > THanks for your response. The validation methods are not called on a > create, allowing the save method to be called, unprotected. I dont > want the save to be called let alone fail. Is there any chance you could post your controller code. I wonder whether you

Re: [Rails] warning: already initialized constant

2012-05-30 Thread Michael Pavling
On 30 May 2012 12:07, Gurdipe Dosanjh wrote: > I have checked and its not been called anywhere else, but may be im missing > something simple > > it always gives a warning on the last entry of the set of values  in > assigned to the constants I would recommend putting a breakpoint on the line tha

Re: [Rails] warning: already initialized constant

2012-05-30 Thread Michael Pavling
On 30 May 2012 10:44, Gurdipe Dosanjh wrote: > Loading development environment (Rails 2.1.0) > /denorm_brag_report.rb:423: warning: already initialized constant > MAIN_CATEGORIES Does your code include the denorm_brag_report.rb file more than once? -- You received this message because you are s

Re: [Rails] Rails developer required.

2012-05-23 Thread Michael Pavling
On 22 May 2012 09:00, cmittal wrote: > what's wrong with this? It doesn't demonstrate *any* willingness by the OP to put in effort into recruiting for their position. Typically, the stage of trying to attract people is when you try your hardest to put on a good show; so if this is an indication o

Re: [Rails] loop in rails view

2012-05-22 Thread Michael Pavling
On 22 May 2012 15:36, amvis wrote: > basically  with that if condition, i need to show different div, > > <% @update_coupon.each do |doc| %> >       <% if  doc["value"] == 2 %> >          //code >       <%elsif  doc["value"] == 5 %> >         //code >       <%elsif  doc["value"] == 6 %> >        /

Re: [Rails] Rails developer required.

2012-05-22 Thread Michael Pavling
On 21 May 2012 22:57, Suraj B. wrote: > If you are experienced rails developer please let me know. worst job ad ever -- 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.c

Re: [Rails] can someone explain how map! / connect! works in this case?

2012-05-18 Thread Michael Pavling
On 18 May 2012 04:57, Christopher D. wrote: > ary = [0,1,1,1,1,3] > ary.map! { |num| %w(zero one two three)[num] } > > I just don't get it, how does it know which value to write out? you're taking the numbers 0,1,1,1,1,3 and for each of them you're populating an array with the values from another

[Rails] Rails, you are so nice

2012-05-16 Thread Michael Pavling
Just feel like it's time to put some love out there. I've spent the day chopping up years-old scripts that did lots of querying and looping (pesky PHP coders trying to write Ruby...) and have replaced tonnes of methods with a few nicely chained named_scopes (I'm still mired in Rails2.1 for this pr

Re: [Rails] Ror code please just help me in findng solution

2012-05-16 Thread Michael Pavling
On May 16, 2012, at 11:05 AM, Prajwal B. wrote: > or else even i can talk vulgar than you see how this > rascal. *ker-splunk* Another one in the "ignore filter" pool... -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this gro

Re: [Rails] how to encryption and decryption a string or integer in ruby

2012-05-10 Thread Michael Pavling
On 10 May 2012 11:01, honey ruby wrote: > i want to encrypt and decrypt a number or string in RoR. is there any > gem or plug-in for that. http://lmgtfy.com/?q=ruby+encrypt+decrypt -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post

Re: [Rails] how to prevent the user from accessing the app.after logout with back button(rails only)

2012-05-10 Thread Michael Pavling
On 10 May 2012 08:46, hanish jadala wrote: > thanks for your reply i have added your code and i checked it. if i click > back button after logout it is still going back to app but it is give me the > error " > > undefined method `username' for nil:NilClass" it shows it going back to app. It's not

Re: [Rails] how to prevent the user from accessing the app.after logout with back button(rails only)

2012-05-10 Thread Michael Pavling
On 10 May 2012 07:54, honey ruby wrote: > after logging out of my site if i click back button it is going back > how can i restrict this problem It's a browser caching issue, so you need to tell the browser not to cache. http://stackoverflow.com/questions/711418/how-to-prevent-browser-page-cachi

Re: [Rails] Re: Sorting of users depending on

2012-05-09 Thread Michael Pavling
On 9 May 2012 11:51, Ajit Teli wrote: > Can I do it by using sorttable.js ? I have included table headers, > sorttable.js. And also I have changed the table class to > class="sortable". But it is not working. No idea - that's nothing to do with Rails AFAIK - it's all front-end stuff; JS manipulat

Re: [Rails] Re: does it really achieve the productivity advantages it claims?

2012-05-09 Thread Michael Pavling
On 9 May 2012 10:46, Peter Hickman wrote: > I'm pretty sure that no one ever claimed that Rails makes you psychic. I could sense you were gonna type that... -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send ema

Re: [Rails] Sorting of users depending on

2012-05-09 Thread Michael Pavling
On 9 May 2012 07:34, Ajit Teli wrote: >  Currently I am > sorting (order) users depending on email id. I would like to sort the > users depending on checkbox status so that selected (checked) users will > be listed first and then other emails will be listed in the order of > email. The first step

Re: [Rails] Re: validating input values(integer)

2012-05-04 Thread Michael Pavling
On 4 May 2012 09:41, Soichi Ishida wrote: > 1.9.3-p0 :008 > 'this'.to_i >  => 0 > 1.9.3-p0 :009 > > > It's zero...it does not seem good at all ;) That's a different thread entirely ;-) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To

Re: [Rails] validating input values(integer)

2012-05-04 Thread Michael Pavling
On 4 May 2012 08:16, Soichi Ishida wrote: > But interestingly, if I input, say, 'this' in the input form, it directs > to the next page and the '0' (an integer, though) value is inserted in > the DB.  I do not have any default value to 'price'. If you pop open a Rails console and type: 'this'.

Re: [Rails] Why I have to set two unnecessary params in controller action after i send form_tag?

2012-05-03 Thread Michael Pavling
On 3 May 2012 15:16, regedarek wrote: > https://gist.github.com/2585733 > > This is my code. "send" is an critically important method in Ruby - probably best to name your action something else. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" g

Re: [Rails] Re: Re: Hosting application on private network.

2012-05-03 Thread Michael Pavling
On 3 May 2012 13:10, Ajit Teli wrote: > Fy final idea is to host the application worldwide. All the http > requests to public ip (122.166.7.181) with port 8050 should be directed > to my system and users should be able to browse the app. I have > configured the router for port-forwarding. But it i

Re: [Rails] CSV Import Issue

2012-05-01 Thread Michael Pavling
On 1 May 2012 17:29, Rahul B. wrote: > I am getting an error "NoMethodError". The error would have told you which line and file the error was on. If you can share that information, then it may be easier to help suggest solutions. -- You received this message because you are subscribed to the Go

Re: [Rails] Is my developer dodgy?

2012-04-27 Thread Michael Pavling
On 27 April 2012 14:57, Emanresu wrote: > I need some help... Didn't you post this three days ago? -- 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 fr

Re: [Rails] Re: To developers of Rails: Feeble documentation - weakness of Ruby and the Ruby on Rails (2nd edition)

2012-04-26 Thread Michael Pavling
On 26 April 2012 14:13, Scott Ribe wrote: > On Apr 26, 2012, at 1:36 AM, Michael Pavling wrote: > >> Again *which* bit of documentation needs to be better > > Nearly every frickin' time I look something up. Rails docs are really awful > compared Now, this is wher

Re: [Rails] Re: To developers of Rails: Feeble documentation - weakness of Ruby and the Ruby on Rails (2nd edition)

2012-04-26 Thread Michael Pavling
2012/4/26 Karthikeyan A.K : > I strongly feel Rails community should have a good documentation like PHP > people have. that will surely increase number people who want to learn and > use Rails. Again *which* bit of documentation needs to be better... how many times have you honestly been confo

Re: [Rails] Missing Method as Filter

2012-04-26 Thread Michael Pavling
On 26 April 2012 00:31, Christopher D. wrote: > User.find_by_username("Tom")? 1 : 0 > > How would I find out Tom's corresponding id? > > For example I'm looking for something along the lines of: > User.find_by_username("Tom").id (user = User.find_by_username("Tom")) ? user.id : 0 -- You rece

Re: [Rails] Re: To developers of Rails: Feeble documentation - weakness of Ruby and the Ruby on Rails (2nd editi

2012-04-25 Thread Michael Pavling
On 25 April 2012 15:36, Kevin Bedell wrote: > On Tue, Apr 24, 2012 at 4:10 PM, Robert Walker wrote: >> Languages are MUCH smaller in scope than frameworks. > According to ohloh.net, rails has about 250,000 lines of code, while > Ruby recently eclipsed 1 million lines of code. "scope" != "LoC" -

Re: [Rails] Re: Re: To developers of Rails: Feeble documentation - weakness of Ruby and the Ruby on Rails (2nd e

2012-04-25 Thread Michael Pavling
On 25 April 2012 11:11, Sergey Ezhov wrote: > Try, for example, to find a method "method_missing". Fail! http://rubydoc.info/stdlib/core/1.9.3/BasicObject#method_missing-instance_method example fail... > How I can trust documentation in which methods about which I already > know aren't describe

Re: [Rails] Re: To developers of Rails: Feeble documentation - weakness of Ruby and the Ruby on Rails (2nd editi

2012-04-25 Thread Michael Pavling
On 25 April 2012 10:20, Sergey Ezhov wrote: > I don't know, what advantage is received by developers from popularity > of language, from popularity of framework. Again, you're posting without quoting, so I have no idea what you're referring to. > Really very many people stop and leave from Ruby

Re: [Rails] Re: To developers of Rails: Feeble documentation - weakness of Ruby and the Ruby on Rails (2nd editi

2012-04-25 Thread Michael Pavling
On 25 April 2012 09:50, Sergey Ezhov wrote: I assume that because you're using Ruby Forum, you're not quoting. Please bear in mind that the forum is just a wrapper that some people use to hide the mailing list. For those of us who use the mailing list, un-quoted replies are barely legible. > And

Re: [Rails] Re: To developers of Rails: Feeble documentation - weakness of Ruby and the Ruby on Rails (2nd editi

2012-04-25 Thread Michael Pavling
On 25 April 2012 06:03, Sergey Ezhov wrote: > There is a set of examples where people approached more responsibly to > documentation creation, for example: http://www.yiiframework.com, > http://kohanaframework.org, http://framework.zend.com/ There is an Agile methodology argument that documentati

Re: [Rails] Re: beginning_of_month problem

2012-04-12 Thread Michael Pavling
On 12 April 2012 13:41, Colin Law wrote: > Life would be much simpler if the world did not go round. Or if we decimalised time ;-) -- 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

Re: [Rails] Re: I have a csv file i need to upload and for each row check that a number of columns do not match a certain criteria

2012-04-12 Thread Michael Pavling
On 12 April 2012 00:54, Gurdipe Dosanjh wrote: > I have a csv file i need to upload and for each row check that a number > of columns do not match a certain criteria > > Is there a way I can do this in ruby? Yes. Which bit are you stuck on? Uploading a file? Reading each row? or Checking the cer

Re: [Rails] Re: What Model Association?

2012-04-05 Thread Michael Pavling
On 5 April 2012 01:54, Mark P. wrote: > I just realized CarWashStation might be misleading. Each station refers > to one "activity location" that the car mush move through per wash. A > few example instances might be: > >  - Soap Application Station >  - Bristle Brush Station >  - Wax Station >  -

Re: [Rails] What Model Association?

2012-04-04 Thread Michael Pavling
On 4 April 2012 22:39, Mark 01 wrote: > I have the following two models and am not quite sure how they should be > associated. > > - Car > - CarWashStation > > At any given time, an instance of Car will be at (belong to?) one of a > dozen car wash stations. What associations should I use (if any)

Re: [Rails] issues with model in ruby on rails

2012-04-03 Thread Michael Pavling
On 3 April 2012 09:12, amvis wrote: > class User < ActiveRecord::Base >   has_one  :system_admin > end > > @user = User.find_by_user_name(user_name) >               if !@user.system_admins.nil? >                  puts 'am a sys_admin' > > The above code gives error Since you've defined the associ

Re: [Rails] Re: semi-OT: Is there an NNTP accessible version of this lis

2012-03-26 Thread Michael Pavling
On 26 March 2012 08:28, THUFIR H. wrote: > Or, you could just use a newsreader, which, presumably, is what the OP > was after -- gmane.* groups.  It's an e-mail => nntp gateway, the web > interface isn't really necessary at all. ??? Is this night of the living dead thread? 7 years old... do you t

Re: [Rails] gsub

2012-03-23 Thread Michael Pavling
On 23 March 2012 13:46, Aaron Schmitz wrote: > is it a permission issue on win xp? > the command is ok, i tested it in cmd.exe Probably... I recommend a nice Linux install (even just a VM... ;-) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"

Re: [Rails] gsub

2012-03-23 Thread Michael Pavling
On 23 March 2012 12:49, Aaron Schmitz wrote: > next question! :D > system("i_view32.exe C:\Rails\test.png /convert=C:\Rails\test.jpg") > doesn't work. What happens when you try: system("i_view32.exe C:\\Rails\\test.png /convert=C:\\Rails\\test.jpg") ? -- You received this message because you

Re: [Rails] gsub

2012-03-23 Thread Michael Pavling
On 23 March 2012 10:36, Aaron Schmitz wrote: > hi, > > im getting tired on this one. > i want to replace all forwardslashes with backwardslashes. > > irb: > r = "C:/RAILS/" > r.gsub("/", "\\") or r.gsub("/") {('\'} both give me: > "C:\\RAILS\\" > > how can i use gsub to display only one "\"? It's

Re: [Rails] Modifying a gem, best way to deploy

2012-03-21 Thread Michael Pavling
On 21 March 2012 02:45, wrote: > For a project I used the gem 'event_calendar'. However, there were a > couple things I had to manually change within the gem source to suit my > needs. > > How would I go about to deploy this in production 'the rails way'? A few choices: * Vendorize it * Package

Re: [Rails] The uniqueness for a field

2012-03-18 Thread Michael Pavling
On 18 March 2012 10:52, Soichi Ishida wrote: > Is there anyway to allow Videos to have the same 'value's, which however > are distinct from each other among the values that a single Video > possesses? GIYF: http://stackoverflow.com/questions/5494660/how-to-validate-uniqueness-in-rails-3-model-if

Re: [Rails] Re: Agile web development with rails 4th edition adding sizes to the product

2012-03-18 Thread Michael Pavling
On 18 March 2012 10:10, Shaban K. wrote: > What am I doing wrong? You're not going through the whole tutorial, understanding it, and then moving on to develop your own projects. By all means twiddle with the example code, but always be able to get back to how the book says it should be, or else

Re: [Rails] distinctively difficult to do what I want

2012-03-16 Thread Michael Pavling
On 16 March 2012 16:59, Colin Law wrote: > On 16 March 2012 15:41, bingo bob wrote: >> I have a database with a lot of Name objects in it, some have the same >> given name - ok fairly normal. >> >> I simply wish to return all the Names with a unique given name. >> *important* I an array of object

Re: [Rails] NoMethodError

2012-03-12 Thread Michael Pavling
On 9 March 2012 19:52, AndyLikesRuby wrote: > I am getting this error message when I try to hit a certain URL: > > http://localhost:3000/captionfiles > > NoMethodError in CaptionfilesController#index > undefined method `all' for Captionfile:Class > app/controllers/captionfiles_controller.rb:5:in `

Re: [Rails] Include Advanced

2012-03-08 Thread Michael Pavling
On 8 March 2012 22:49, Rogelio A. RogeX wrote: > Hi, As I can do Include with parameters?? > > Example > > Modelo.find(:all,:include => [otroModelo(param,param)]) Modelo.find(:all,:include => :otro_modelo, :conditions => ["otro_modelos.param1 = ? and otro_modelos.param2 = ?", param, param]) --

Re: [Rails] [Rails Guides] Getting Started 7.4 - Array Output Problem

2012-03-08 Thread Michael Pavling
On 7 March 2012 12:04, NoobyOnRails wrote: > When I want to show the comment I get the following output under my > comment: > > [# post_id: 1, created_at: "2012-03-07 11:48:02", updated_at: "2012-03-07 > 11:48:02">] You're possibly doing this: <%= @my_object.comments.each do |comment| %> #

  1   2   3   4   5   6   7   8   9   10   >