[Rails] [JOB] App re-write

2012-12-19 Thread Bill Walton
I have an application that needs to be rewritten in Rails and am beginning
the process of identifying potential vendors and obtaining bids.  The app
is currently written in Perl / Catalyst though I do not believe that a lack
of experience in that language / framework will be an obstacle.  The
objective of the re-write is to reproduce the app's existing functionality
from an end-user perspective.  Bidders will be able to use the existing app
and will have access to a set of training videos.  I'm interested in
getting this done quickly, so one-man-shops will not be considered.  If
you're interested, please contact me at my business email address: bill at
raybec dot com.  Replying to the list, rather than to the email address
given in the last sentence, will be taken as evidence of an inability to
follow simple instructions.  If you do so, do not not expect a reply.

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Streaming in Rails 3.2

2012-12-09 Thread Bill Walton
The other way is to couple your app with either Faye or Juggernaut.

On Sun, Dec 9, 2012 at 8:27 AM, Norbert Melzer timmel...@gmail.com wrote:

 I the client poll every few seconds via AJAX. There is no other way.
 Am 09.12.2012 14:28 schrieb Ravi Laudya mouryar...@gmail.com:

 Hello all,

 I am writing an app to stream log files (or any files) on the browser as
 they grow. The idea is that the rails app should do a 'tail -f' on the file
 and keep sending the data to the browser. I was thinking if there was any
 way to achieve this in rails.

 Through googling, I came across the 'streaming' support in rails. But, I
 didn't get it working. Here is what I tried

 class LogsController  ApplicationController

   def index
 headers['X-Accel-Buffering'] = 'no'
 self.status = 200
 self.response_body = Streamer.new
   end

 end

 class Streamer
   def each
 10.times do |n|
   yield Streaming...#{n} 
   if (n % 1000 == 0)
 sleep 1
   end
 end
   end
 end

 The browser time outs waiting for the data.

 Can you please let me know how can I achieve this functionality in rails?


 thanks
 ravi

 --
 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 from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 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 from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] How to allow the user to user their own domain name

2012-12-06 Thread bill walton
Hi Loganathan,

On Thursday, December 6, 2012 4:12:22 AM UTC-6, Loganathan Sellappa wrote:

 Please have a look on to the www.shopify.com, where each user can create 
 a store with unique domain(subdomain) name like www.logan.shopify.com.



This is the stereotypical Rails approach to multi-tenancy.  The database 
contains, in the case of Shopify, the products of many stores (logan is a 
store).  The key to multi-tenant apps is to ensure that all requests are 
scoped to a specific store.  In order to accomplish this in a Rails app a 
before_filter is used in application_controller.rb.  It typically looks 
like this.

def current_store
  @current_store ||= Store.where(subdomain = ?, request.subdomains.last)
end

The request to retrieve products (current_store.products) will retrieve 
only those records that belong to the correct (per the url) store.

 


 Currently I creating the same kind of application but I need an extra 
 feature where user can choose their own domain name while store 
 registration process like www.logan.com instead of  
 www.logan.shopify.com http://www.loganathan.shopify.com. The thing is 
 user can point their store with their own domain(can be registered with 
 any providers like Godaddy,Dreamhost) instead of subdomain.



I'm assuming that you mean you want the user to be able to choose to use 
one or the other.  You'll probably get more readable code by adding a 
domain field to the stores table and have it default to your app's domain.  
The current_store method could end up looking something like...

def current_store
  unless @current_store
 if request.domain == 'shopify.com'
   @current_store = Store.where(subdomain = ?, 
request.subdomains.last)
 else
@current_store = Store.where(domain = ?, request.domain)
 end
  end
  @current_store
end

HTH,
Bill 


-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/2P-d4PGdgp4J.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Rails and services - Architecture question

2012-10-29 Thread Bill Walton
Hi Pierre,

On Mon, Oct 29, 2012 at 10:50 AM, PierreW wamre...@googlemail.com wrote:

 Hi guys!

 We have moved a part of our Rails app into a service, i.e. a Ruby
 script that is demonized and communicates with the main app through a
 message queue.
 This service needs to know about the models in the Rails app, but it
 does not need a database connection. Indeed, we are making sure that
 in this service, no call to the DB will be made.

 How would you do that? At the moment, we are simply requiring the
 models files in the service. But since they inherit from
 ActiveRecord::base, it won't work if there is no connection to a DB
 available.

 Thanks!
 Pierre



Not sure if the approach is applicable to your situation without knowing
more but if you run the script via runner (starting it from the app root,
it will have access to the Rails environment, including your models.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Re: Rails and services - Architecture question

2012-10-29 Thread Bill Walton
Hi Pierre,

On Mon, Oct 29, 2012 at 11:23 AM, PierreW wamre...@googlemail.com wrote:

 Hi Colin, Bill

 Here is what we are doing:

 - we pass to our service the Model objects (we Marshal.dump them in
 the main app, enqueue them, and the service Marshal.load them) instead
 of their unique ID.
 - in the service, we just need to access some of the models' methods.
 We know these methods don't need a DB connection.

 The reason we have it setup like this is initially, we were running
 these tasks in threads within a background job (threads caused a bunch
 of issues when we were using the DB, so we made sure what we passed to
 the threads would never use the DB).

 Bill: we run this service completely independently, on a different
 box. So it does not have access to the app.

 Maybe we should not be doing something like this?


If the methods don't need access to the DB, then the question is do they
need access to the AR object?  Or are they being passed the data they need
to work on as arguments?  If the latter, then they're more 'helpers' and
could be re-factored out into a module to be included in the model and,
independently, in the service.  If that doesn't sound feasible, post some
code so we can see better what you're doing.

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] more misleading content on the web regarding ruby method lookup algorithm

2012-10-06 Thread Bill Walton
Hi John,

On Sat, Oct 6, 2012 at 2:43 PM, John Merlino stoici...@aol.com wrote:

 I read this article:

 http://www.madebydna.com/all/code/2011/06/24/eigenclasses-demystified.html

 Author makes claim that are flat out wrong. She says: Class gets
 pushed up the lookup chain and becomes a superclass. That statement
 is flat out wrong.


Nice job.  Just FYI, Dave Thomas did a Screencast series on Ruby
MetaProgramming, the first of which covers this very clearly.  I found it
well worth the $5.

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Re: New to Rails. Looking for some help

2012-09-21 Thread Bill Walton
Hi John,

On Fri, Sep 21, 2012 at 7:37 AM, John B. li...@ruby-forum.com wrote:

 Bill -

 Thanks so much for your response. I spent a good portion of yesterday on
 google trying to solve this. I was dancing around the solution. I
 appreciate your help.


You're welcome.  And welcome to the Rails community!

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] New to Rails. Looking for some help

2012-09-20 Thread Bill Walton
Hi John,

On Thu, Sep 20, 2012 at 1:52 PM, John B. li...@ruby-forum.com wrote:

 I have been working with Ruby on Rails for about a week.

 I am trying to figure out a problem.

 I have a small relational database.

 resources :client do
   resources :department do
 resources :task
   end
 end

 What I want is to be able to add tasks while looking a specific show
 of a department.

 /app/view/department/show.html.erb

 h1 Department: /h1
 %= render @department %
 h2 Tasks: /h2
 %= render @department.tasks %
 h2 Add a Task: /h2
 INSERT FORM HERE

 now I am likely to want to move this off as a partial under the /tasks
 but at a basic level how do I create this form?

 In order to do this I know I have to define the create method in my
 tasks controller and then create a %= form_for  %   I am just
 struggling with this.

 Please help!

 Thanks


Success in Rails comes most quickly to those with strong Google Fu.

rails 3 form_for nested resources

yields good results.

You might want to start with this one:
http://stackoverflow.com/questions/2034700/form-for-with-nested-resources

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Help getting started: Newbie: Windows and Rails

2012-09-02 Thread Bill Walton
Hi Bruce,

On Sun, Sep 2, 2012 at 6:00 AM, Bruce Whealton br...@whealton.info wrote:

 snip




 Anyway, I keep going in circles.  I get a message saying that I need to
 install gem msyql2 which I do and it reports back with no error and so I
 try again to install the app with the rails command and I get the same
 error.



I took a quick look at that tutorial, and if that's all you did you should
be getting the index.html file that Rails installs (the tutorial left out
the part where it tells you that you have to delete it).  If you did that,
then you're into the app itself and your problem description doesn't say
much about what you did in addition to the tutorial.


So need a little more info.  How are you installing the mysql2 gem?
Are you using Bundler?  Is the gem specified in the Gemfile?   Were you
able to rake db:migrate or is that where you're having your problem?

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Re: hii friends,,,,,i m new to rails......i think there is a problem in destroy command .

2012-08-16 Thread Bill Walton
On Thu, Aug 16, 2012 at 3:09 PM, AmateurCoder
amateurgol...@insightbb.comwrote:


 Are you saying to run rails destroy model foo and foo doesn't exist then
 you should get an error or exception message?  If you try this on the
 command line rails destroy model foo, it will run the opposite of the
 generate command; however, nothing ever existed, so can't see the harm.

 On Thursday, August 16, 2012 12:03:47 AM UTC-5, Fahim Patel wrote:

 let me explain this problem 
 ---rails destroy---**-this
 command destroy model,scaffold etc .
 problem is that if a model or other structure is exist than ,this command
 will destroy all the related file to it...good ..till now no
 problem...
 but problem is that if a model etc is not exist than till this command
 remove the file ...it should not be done.there is no such a file name
 exist..
 some error or exception should be execute at this time 

 i think this a problem???
 if not than expalin me..


The behaviour is consistent with other commands.   If, for example, you run
'rake db:migrate' and there are no migrations that need to be run, the task
simply returns you to the command line without comment.  One might make the
argument that it _should_ say something like 'there are no migrations that
need to be run.'  Or one might start submitting patches and see what the
community thinks ;-)

Best regards,
Bill



 Regards
 Fahim Babar Patel

  --
 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 from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/rubyonrails-talk/-/uAJe7mwsZkEJ.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Re: [JOB] Ruby on Rails Positions at IBM (co-op and full-time)

2012-08-13 Thread Bill Walton
Please reply directly to the OP, not to the list.

On Mon, Aug 13, 2012 at 11:11 AM, kishore s. li...@ruby-forum.com wrote:

 Hello,

  I am kishore i completed my ruby on rails course I heard that IBM
 is looking for ruby on rails developer.I am writing to express my
 sincere interest in securing employment with your organization.I would
 like to offer my service to your organization.My resume is enclosed for
 your kind review.Thank you for your attention and time. I certainly look
 forward to hear from you.

 Attachments:
 http://www.ruby-forum.com/attachment/7677/Kishore.R_resume.doc


 --
 Posted via http://www.ruby-forum.com/.

 --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To post to this group, send email to rubyonrails-talk@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Eager Load Grandchilden w/o Children

2012-08-10 Thread Bill Walton
Hi Tyler,

On Thu, Aug 9, 2012 at 2:32 PM, t.pickett66 ty...@therapylog.com wrote:

 I have several models that are all linked together in a time
 tracking/billing system ala:

 class Claim  AR::B
   has_many :appointments

   def student
 @student ||= Student.joins(student_appointments:
 :claim).where('`claims`.`id` = ?',self.id).group('`students`.`id`').first
 #second draft
 # @student ||= (student_appointments.size == 0 ? nil :
 student_appointments[0].student) #first draft
   end
 end


 class Appointment  AR::B
   belongs_to :claim
   belongs_to :student
 end


 class Student  AR::B
   has_many :appointments
 end

 My users that administer these accounts want to be able to look at claims
 in the index but need to know who these claims were for. My first attempt
 building the view resulted in 2*N + 1 queries for getting the student's
 name, the second implementation paired that down to N+1 but obviously that
 still sucks. To totally avert the N+1 query problem typically I'd just
 eager load what I needed via Claim.includes(:appointments = :student) but
 I'd really like to avoid this here since I'll never actually use the
 appointments in the view. I've tried a has_one :through but rails doesn't
 allow a collection to then point at a single record this way, I've also
 tried just loading them via: Student.joins('join through to
 claims').where(claims.id in (?),claims.map(:id)) in the
 presenter/controller but since everything is lazy loaded the query never
 gets executed and then the N+1 loads start. The third though I had was
 doing a belongs_to with conditions but there isn't any way to include
 joins in there so that's out. My last thought is to do something like:

 class Claim  AR::B
   has_many :appointments
   has_one :appointment
   has_one :student, :through = :appointment
 end

 but that clutters up the methods and would leave us open to the mistake of
 looking for the collection and getting the single. Are there any
 suggestions out there aside from loading the whole tree?



If it were me, I'd get rid of the student method and just put a has_many
and belongs_to relationship directly between Student and Claim.  You can
have both that and the relationship through Appointment.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




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

2012-08-09 Thread Bill Walton
On Thu, Aug 9, 2012 at 10:07 AM, Michael Pavling pavl...@gmail.com wrote:

 On 9 August 2012 16:04, Ed W li...@wildgooses.com 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 their desk?
 
  A few details to narrow down scope since it might affect the advice,
  apologies in advance, trying to NOT make this an advert in itself:
  - We are based in London
  - Looking to hire local, permanent staff
  - Small company looking for self reliant people who can work
 independently

 I look at posts on here, on LRUG and on Jobsite.


Given that you're looking for local folks, you'll definitely be best served
by local sources like lrug.org.  I would also strongly recommend that you
not limit yourself to posting on board or a list.  You'll greatly improve
your chances if you invest the time to introduce yourself to the community
in person.  Attend a LRUG meeting or two.  Go buy a round at a local
hacknight.  Etc.

Best regards and good luck!
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Is twitter devloped in Ror

2012-07-16 Thread Bill Walton
Twitter was initially developed on Rails.  The front end is still Rails.
They had to do some middle-ware replacements a while back to scale.  Google
'rails twitter' for more history.

On Mon, Jul 16, 2012 at 8:21 AM, Yaw Boakye elGran yawboaky...@gmail.comwrote:

 @Amit when was that? Their last blog post about the making of their mobile
 web app is the only time I have seen them mention Rails.

 --
 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 from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en-US.


-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en-US.



Re: [Rails] a hands-on tutoring needed

2012-07-01 Thread Bill Walton
Hi Sehrguey,

On Sun, Jul 1, 2012 at 8:04 AM, sehrguey o. li...@ruby-forum.com wrote:
 dear each, and all and others,

 being a completeest newbie to RoR and having got dumb by a month or so
 of googling how to add search faculty to a web app, I ask you for
 help.

 All I got is a database of 200 records so there is no need for sphinxes,
 sunspots, elasticsearches, searchlogics, ferrets and other highly
 esteemed and advanced engines and plugins. Thank you, sir. No.


Were these records created with a Rails app?  Do you have a basic
Rails app that you're trying to extend with search functionality?  Or
do you want to create a Rails app?  What you want to do is very
simple.  Just trying to understand your starting point.

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en-US.



[Rails] utf-8 character in non-english locale file throwing Encoding::CompatibilityError exception

2012-06-18 Thread Bill Walton
Greetings!

I'm having a very strange problem I could use help understanding. I've
got 2 locale files: en.yml and fr.yml. When I have a utf-8 character
in the en.yml file it displays fine. When I put that exact same
character in the fr.yml file, I get an Encoding::CompatibilityError
exception

Here's the entry that's causing the problem:

firstname_placeholder: Prénom

I've tested with other characters and any utf-8 in the non-english
translation causes the same exception. Anybody got any idea why utf-8
works fine in the english locale file but not in the non-english file?

Thanks, Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] How to use a text_field for dates?

2012-06-17 Thread Bill Walton
Hi Marc,

 On Thu, Jun 14, 2012 at 7:23 PM, Marc C. li...@ruby-forum.com wrote:

 Hello,

 I need to accept dates in a form using a text_field and not a
 date_select. Why? Well, because for users it's faster to type a date.

 But if I enter a simple date like 13/05/2012 (dd/mm/ format), when
 I want to edit this register, in the text_field appears 2012-05-13.

 How can I change this behavior, so in the text_field appears
 13/05/2012?

 Thank you!



You can use the #strftime method to easily accomplish what you want.

ruby-1.9.2-p290 :001  require 'date'
 = true
ruby-1.9.2-p290 :002  d = Date.parse('2012-05-13')
 = #Date: 2012-05-13 (4912121/2,0,2299161)
ruby-1.9.2-p290 :003  d.strftime('%d/%m/%Y')
 = 13/05/2012

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Gallery in RoR

2012-05-21 Thread Bill Walton
Hi Lauris,

On Mon, May 21, 2012 at 8:56 AM, Lauris Zaicevs li...@ruby-forum.com wrote:
 Hi all!

 I want to create a simple gallery in Ruby on Rails app, where i can
 upload, edit and delete it.

 Could you suggest some tutorilal, how to create that?


http://railscasts.com/episodes/253-carrierwave-file-uploads

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Opportunity for Ruby On Rails Developer

2012-05-12 Thread Bill Walton
The rule in the past was that posted on the group's home page was that
job postings were allowed but should include the string '[JOB]' in the
subject line so that those who did not wish to see the postings could
create a filter.  The home page now contains no statement of any sort
about anything.  Not sure who is in charge of that.  Barring a
statement to the contrary,it seems to me that job postings are
allowed.


On Sat, May 12, 2012 at 9:11 AM, Greg Akins angryg...@gmail.com wrote:
 On Fri, May 11, 2012 at 12:06 PM, Pandya, Amit a.p.pan...@gmail.com wrote:
 can someone ban this girl?, This is not a job posting place.


 There have been several job postings lately.  Are those prohibited by
 the group rules?

 I actually appreciate seeing the job postings.  And ignoring them is easy.

 --
 Greg Akins
 http://twitter.com/akinsgre

 --
 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 from this group, send email to 
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/rubyonrails-talk?hl=en.


-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: rails query [3.2]

2012-04-21 Thread Bill Walton
Hi Erwin,

I'm sorry I didn't see your first post.

On Sat, Apr 21, 2012 at 8:12 AM, Erwin yves_duf...@mac.com wrote:
snip

 I would like to have a single line to get both, posted and commented
 counts
snip

 where am I wrong ?  thanks for feedback

Why do you want to count 2 separate / independent resources in one SQL
statement?  I'd bet a nickel that it's going to be less efficient from
a processing perspective, and it's certainly less readable than:

users = User.includes(:posts, :comments)
users.each do |u|
  puts u.id.to_s + u.posts.size.to_s + u.comments.size.to_s
end

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Protecting code of cookie cutter web sites

2012-04-09 Thread Bill Walton
Hi Ralph,

On Mon, Apr 9, 2012 at 9:44 AM, Ralph Shnelvar ral...@dos32.com wrote:

 So how can I protect the RoR code?

The only real protection available for software today, whether it's
fully visible as in RoR or compiled, is via licensing.  Read the
license on pretty much any piece of packaged software you've bought in
the last 15 years and you'll see that you agree by opening the package
not to reverse-engineer or assist anyone else in reverse-engineering
or to use knowledge gained by using the product to develop a competing
product, etc

The way this works in the US market is based on what's called, iirc,
'primacy of claims.'  (I am not a lawyer, but recommend that you get
yourself one if you're really concerned about this).  Business
contracts have a higher priority in our courts than patent, copyright,
or other IP.  The really good news for software developers is that
violations of business contracts are *much* easier and cheaper to both
create and prosecute than IP violations.  You don't have to prove they
stole your code.  You just have to show they violated the contract.

Get yourself a good business contract lawyer.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: Re[2]: [Rails] Protecting code of cookie cutter web sites

2012-04-09 Thread Bill Walton
Hi Ralph,


On Mon, Apr 9, 2012 at 11:16 AM, Ralph Shnelvar ral...@dos32.com wrote:
snip
 Now is there a technological way rather than a legal way to protect code?

Other than a SaaS offering, I do not know of, and am unable to
imagine, one.  Once the code is out of your physical control, the only
real protection is contractual.  Don't think in terms of protecting
your code.  Think in terms of protecting your business.

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] [ANN] Rails 3.2.3.rc1 was released!

2012-03-27 Thread Bill Walton
Hi Santiago,

On Tue, Mar 27, 2012 at 12:16 PM, Santiago Pastorino
santi...@wyeworks.com wrote:
 Rails 3.2.3.rc1 has been released.
snip
 *ActionPack*

 *   Do not include the authenticity token in forms where remote: true
 as ajax forms use the meta-tag value *DHH*

Could you please point me to more on this?

Thanks,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Fear of sharing

2012-03-25 Thread Bill Walton
Hi Samuel,

On Sun, Mar 25, 2012 at 12:38 PM, Samuel Mensah li...@ruby-forum.com wrote:
 Hi guys, I have an idea for a cool web application...
 snip
 I'm kinda confused.

Agreed.  First evidence is that you've asked a fundamental business
question on a technical forum ;-)

 I'm not sure if I should share it or wait till I'm
 set to do this then maybe tell people about it when I'm done with a
 prototype... what do you guys think? any advice?

1)  A product (or service) is not a business.  They're separate
things.  The product is typically much easier to build than the
business.
2)  Team is much, much more important to success than Product.  Build
your team.  Then build your product.  If you can't 'sell' your product
to potential team members (i.e., get anyone else as excited by the
idea as you are) then your chances of selling it to paying customers
are pretty much nil.  Be ready and open to redefining your product as
a function of building your team.  The fundamental definition of a
Better product is that more people want to be involved in helping
you build it.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Fear of sharing

2012-03-25 Thread Bill Walton
On Sun, Mar 25, 2012 at 1:10 PM, Samuel Mensah li...@ruby-forum.com wrote:
 Team is much, much more important to success than Product.  Build
 your team.  Then build your product.
  I've thought of this for a while but the fact that you mentioned it
 which rings a bell means I should consider it which I have and I'm going
 to post it as a new topic and anyone interested should email me :)
 HTH,
 Bill

 Thanks Bill :)

You're welcome.  Best of luck to you!

Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Compare arrays

2012-02-27 Thread Bill Walton
On Mon, Feb 27, 2012 at 4:51 PM, Rodrigo Ruiz rodrigo.ru...@gmail.com wrote:
 Ya, that is what I used (with sort), I was just wondering if there is a
 native way like:

No need to waste cycles like that.  Array math will do fine.

 a = [1, 4, 2]
 b = [2, 1, 4]

 a.has_same_elements_as(b)

ruby-1.9.2-p290 :001  a = [4,1,2]
 = [4, 1, 2]
ruby-1.9.2-p290 :002  b = [1,2,4]
 = [1, 2, 4]
ruby-1.9.2-p290 :003  b - a
 = []
ruby-1.9.2-p290 :004  a - b
 = []


HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Compare arrays

2012-02-27 Thread Bill Walton
On Mon, Feb 27, 2012 at 5:29 PM, Rodrigo Ruiz rodrigo.ru...@gmail.com wrote:
 Yes, duplicates are important.

Assuming nil entries may also be important...

ruby-1.9.2-p290 :016  a = [2,1,4,nil,1]
 = [2, 1, 4, nil, 1]
ruby-1.9.2-p290 :017  b = [1,2,2,4,nil,nil]
 = [1, 2, 2, 4, nil, nil]
ruby-1.9.2-p290 :018  a.compact.uniq - b.compact.uniq
 = []
ruby-1.9.2-p290 :019  a
 = [2, 1, 4, nil, 1]
ruby-1.9.2-p290 :020  b
 = [1, 2, 2, 4, nil, nil]

see http://ruby-doc.org/core-1.9.3/Array.html for other interesting
Array methods.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Multiple feature creation.

2012-02-09 Thread Bill Walton
On Thu, Feb 9, 2012 at 5:43 AM, Christopher Jones li...@ruby-forum.com wrote:
 Use an after_create callback in the User model to create the associated
 Wishlist record.

 So in the user model would I define first like this:

 after_create :set_wishlist

 then the following:

 def set_wishlist
  @wishlist = Wishlist.new(params[:wishlist])
 end

 I hope I am on the correct track.

 Any feedback would be great. Thanks.

That's the general idea though, from what you've said, the only thing
you'll know about the Wishlist object at the point of creation is the
User to whom it belongs.  If you need to return it to the user in the
response, as indicated by your creation of a separate instance
variable, you'll want to do that in the User controller prior to
rendering.

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Multiple feature creation.

2012-02-08 Thread Bill Walton
Hi Chris,

Use an after_create callback in the User model to create the associated
Wishlist record.

HTH,
Bill
On Feb 8, 2012 3:25 PM, Christopher Jones li...@ruby-forum.com wrote:

 Hi all I wondering how I would go about generating multiple features on
 user creation. I want every user who signs up to have a wishlist
 automatically which is a separate to the actual users (different
 model/view/controller etc.)

 On user create I want it to create a user as well as create a wishlist.
 The wishlist will be blank but I just want the feature to show on their
 profile so that they can edit. Currently the user has to click on a
 button to set it up.

 Here is my current user create method. I want to add a line to create
 the wishlist alongside. Any help will be appreciated.

 def create
  @user = User.new(params[:user])
  respond_to do |format|
if @user.save
  UserMailer.registration_confirmation(@user).deliver
  session[:user_id] = @user.id
  format.html { redirect_to root_url, :notice = User was
 successfully created. }

else
  format.html { render :action = new }
  format.xml  { render :xml = @user.errors, :status =
 :unprocessable_entity }
end
  end
 end

 --
 Posted via http://www.ruby-forum.com/.

 --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To post to this group, send email to rubyonrails-talk@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.



-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Javascript Ajax Organization

2012-01-22 Thread Bill Walton
Hi Mateusz,

On Sun, Jan 22, 2012 at 11:29 AM, Mateusz W. li...@ruby-forum.com wrote:
...
 Now, if I add an Ajax layer over this, things seem to complicate quite a
 bit. Say, if I want to perform some kind of request using jQuery, I need
 to be able to know the appropriate path to perform this request on (ex,
 users/1/post/new), but this requires me to generate this path
 dynamically in the Rails script.

Maybe I'm missing something but ... You say 'everything' is working
fine without Ajax which, to me, means that you already know the user
id and are sending it to the view when you render the 'new' view.  The
user object is available to you in that view.  So there are a couple
of 'easy' approaches to your problem.  If you're doing a full page
render then you can do an erb substitution into the Ajax url in your
jQuery.  If you'd prefer to grab the user id via jQuery for whatever
reason, you can put it in the page via a hidden_field_tag when you
render the form and use that to construct your Ajax url, perhaps by
binding a function to the .submit.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] I18n effort estimate help needed!

2012-01-20 Thread Bill Walton
I need to provide an estimate (windage-level) for internationalizing /
localizing (both) an existing web app.  The app is built on a
'homegrown' Ruby framework running on jRuby 1.6.5.  If anyone has any
suggestions re: approaches / gotchas to producing an estimate for
this, I'd really appreciate hearing from you.

Thanks,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] posts re consulting/help with projects

2012-01-14 Thread Bill Walton
Hi Dave,

On Sat, Jan 14, 2012 at 4:13 PM, Dave Aronson
googlegroups2d...@davearonson.com wrote:

 What's the feeling here on announcing work, or availability for work?
 The Google Group's page doesn't say anything about it, nor does the
 forum (at least without registering), but I haven't seen many such
 posts, which I think I would if it were considered OK

Not sure when the group's home page was 'minified' (or who is
responsible for maintaining it at this point) but the convention wrt
job postings _used_ to be clearly stated:

Job postings need to be prefixed with [JOB] in the subject line.
There was a time when there were a lot of postings from recruiters and
several list members voiced a preference for this approach so that
those posts could be filtered.  There are a number of Ruby / Rails
-specific job boards now and I guess the recruiters are getting
sufficient response from those that they're mostly leaving the list
alone.

WRT, postings for availability, I don't recall it ever being clearly
resolved.  There was, iirc, a general feeling that shops advertising
their services was both inappropriate and a waste of effort since the
audience here was / is individual developers.  I recall a discussion
wherein the recommendation was that notice of individual availability
be handled via a sig line.

In any event, that was several years ago and, as you noted, the
group's home page (on google) now makes no mention of either case so I
suppose folks are free to do as they choose.  If it gets out of hand
I'm sure someone(s) will bring it up again.

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Observe field with jquery in Rails 3.1

2012-01-11 Thread Bill Walton
Hi Hans,

On Wed, Jan 11, 2012 at 10:35 AM, Hans hans.marmo...@klockholm.se wrote:
 I tries to observe a change  in a field  with jquery in Rails 3.1 in
 order to be able to implement  two cascading select boxes.
 A a first step I just try to observe a click in a div using jquery
 I have the following function in a .js file that is loadedin the head
 section (fieldset is the id of a div) and is displaying a view with
 the div fieldset

 $(document).ready(function() {
 $('#fieldset').bind({
  click: function() {
        alert('Change');
    // do something on click
  },
  mouseenter: function() {
    // do something on mouseenter
  };
 });
  });
 But nothing happens when I click in the field
 I suspect that I am using jquery  in the wrong way

Try giving it an id of a different name.  My guess is that jquery is
'confused' by your use of 'fieldset' as an id because it is also a tag
name.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Equivalent to observe_field in rails 3

2012-01-08 Thread Bill Walton
Hi Venkata,

On Sun, Jan 8, 2012 at 1:57 AM, venkata reddy venkatareddy...@gmail.com wrote:
 Hi every one,
                   i need something like populating all the states
 when a particular country selected. My exact requirement is, in my
 project management tool, when a project is selected all of its
 activities should be populated in the next drop down. I think before
 rails 3 it can be done using observe_field tag. But how to do that in
 rails 3 ( 3.0.10 to be precise) .

AFAIK, the 'observe...' helpers have not been replicated for jquery (
I miss them, too) so the easiest way is to swap out jquery and use
prototoype.js.  jQuery is now the default, but you can continue to use
prototype.js if you like.

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Equivalent to observe_field in rails 3

2012-01-08 Thread Bill Walton
On Sun, Jan 8, 2012 at 11:40 AM, venkata reddy
venkatareddy...@gmail.com wrote:
 As i already mentioned above, i am using 3.0.10 here and the default
 js library is prototype. But still i am not able make observe_field
 working.

Missed that.  Sorry.  In that case I'd need to know more about what
'not working' means.  You might want to start by looking at the page
source.  Is the ajax code there?  If so, is its url pointing to the
action you expect it to be pointing to?  Using Firebug (you can't do
much debugging of ajax without it), when the field changes is the ajax
firing and generating the expected post in the console?  If you
haven't already, put some logging in the controller action.  Is it
getting fired?  With the expected parameter(s)?  Etc...

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] set a default value with simple_form

2012-01-07 Thread Bill Walton
Hello Brent,

On Sat, Jan 7, 2012 at 1:17 PM, brent brent li...@ruby-forum.com wrote:
 hello
 anyone know how i can set a default integer value with simple_form, i
 have code like this below in my view but its not working.

 %= f.input :age, :value = '30' %

 i would like the input box to have the value of 30 by default
 thanks for any help.

If I understand your intent, it has nothing to do with simple_form.
Either a migration-based default value for the database field or a
model-based, after_create filter could be used to set the initial
value of the age field in a newly-created instance of the object.
That, in turn, will have the result that it appears to me you're
trying to achieve.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] js update partial missing template

2012-01-05 Thread Bill Walton
Hi Craig,

On Thu, Jan 5, 2012 at 4:18 PM, Craig White craig.wh...@ttiltd.com wrote:

 pMissing template ... :formats=gt;[:html]}.

That looks like a clue.  Have you checked your request header?

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] js update partial missing template

2012-01-05 Thread Bill Walton
On Thu, Jan 5, 2012 at 4:44 PM, Craig White craig.wh...@ttiltd.com wrote:

 On Jan 5, 2012, at 3:37 PM, Bill Walton wrote:

 Hi Craig,

 On Thu, Jan 5, 2012 at 4:18 PM, Craig White craig.wh...@ttiltd.com wrote:

 pMissing template ... :formats=gt;[:html]}.

 That looks like a clue.  Have you checked your request header?
 
 I think so... I've been staring at firebug and even copied the errors out of 
 firebug and this looks like it wants to respond to html and not js and in 
 fact, I enabled it to 'render :partial = permissions' and it clearly wants 
 to respond with html and not js.

Then my best advice would be to double check the accepts header using
Live Http Headers.  You may need to do some explicit setup prior to
the post.

Bill
 my js is a bit involved...

 $(function() {
    $(#priv_users).on(mouseenter, function() {
        !$(li:first, this).hasClass(ui-draggable)  $(li, 
 this).draggable();
    });
    $([id^=privileges-]).droppable({
        drop: function(event, ui) {
            $(this).addClass(ui-state-highlight);
            $.post(/permissions/add_member/, {
                uid: ui.draggable.attr(data-add),
                id: $(this).attr(id)
            }, function(data) {
                var html = $(data);
                $(#messages1).replaceWith(html.closest(#messages1));
            });
        }
    });
 })

 Craig

 --
 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 from this group, send email to 
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/rubyonrails-talk?hl=en.


-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] js update partial missing template

2012-01-05 Thread Bill Walton
On Thu, Jan 5, 2012 at 5:26 PM, Craig White craig.wh...@ttiltd.com wrote:

 On Jan 5, 2012, at 3:57 PM, Bill Walton wrote:

 Then my best advice would be to double check the accepts header using
 Live Http Headers.  You may need to do some explicit setup prior to
 the post.
 
 wish I understood what you are trying to tell me here

My apologies.  Not sure which part of the three above I should
address, so here's all three.

1) Rails decides which respond_to block to use based on the request's
Accept header.  Here's a link that should help on that front.
http://www.gethifi.com/blog/browser-rest-http-accept-headers

2) Live HTTP is a plugin for Firefox that shows you the headers for
each request-response cycle.  I've pasted in the first frame you'll
get visiting the link above below.  It's got 2 sections.  The first
shows the headers sent on the request.  The second shows the headers
sent on the response. The Accept header content is on the 4th line of
the request section.  In this case, the client is telling the server
that its first preference is for html and you can see from 2nd line in
the response section that that is what the server sends back.


GET /blog/browser-rest-http-accept-headers HTTP/1.1

Host: www.gethifi.com

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.24)
Gecko/2007 Ubuntu/10.04 (lucid) Firefox/3.6.24

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language: en-us,en;q=0.5

Accept-Encoding: gzip,deflate

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive: 115

Connection: keep-alive

Referer: 
http://www.google.com/url?sa=trct=jq=esrc=ssource=webcd=3ved=0CDwQFjACurl=http%3A%2F%2Fwww.gethifi.com%2Fblog%2Fbrowser-rest-http-accept-headersei=9z4GT6y7K4X-sQKd25SRCgusg=AFQjCNFXKdbpcUNstr0O0jkYtWvhb4EjYQsig2=Ycrt2dIClGHE4IldZUeJzw

Cookie: __utma=1.1465277256.1325809449.1325809449.1325809449.1;
__utmb=1.1.10.1325809449; __utmc=1;
__utmz=1.1325809449.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided);
__lo__roomid=2489

Cache-Control: max-age=0



HTTP/1.1 200 OK

Content-Type: text/html

Expires: Thu, 05 Jan 12 19:20:20 -0500

Cache-Control: max-age=60

Vary: Accept-Encoding

Content-Encoding: gzip

Content-Length: 21416

Accept-Ranges: bytes

Date: Fri, 06 Jan 2012 00:25:13 GMT

Connection: keep-alive


3) If what you see from looking at what's produced in Live HTTP by
your post is that the request's Accept header is not requesting
javascript (text/script iirc) then the problem is explained.  The
'fix' is to set the request's Accept header.  I did a quick google on
'jquery ajax set header' and got good results.  This one looked like a
good place to start.
http://snipplr.com/view/9869/

This one might be a good look if the one above doesn't get you the
results you need.
http://stackoverflow.com/questions/1145588/cannot-properly-set-the-accept-http-header-with-jquery

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Bypass XHR redirect by overriding redirect_to

2011-12-23 Thread Bill Walton
Hi Michael,

On Thu, Dec 22, 2011 at 6:33 PM, Michael Mahemoff mich...@mahemoff.com wrote:
 A lot of calls in Rails end in a redirect_to, and this is really an
 unnecessary round trip in the case of XHR calls. This might sound
 crazy, but why not just handle the redirect on the server? I realize
 in some cases a redirect will probably be better if the redirected
 resource is cached, but that's not always the case.

 Is there any advice/prior art on doing such a thing, and is it
 sensible to do it? I'm thinking the best way is to monkey-patch the
 default redirect_to method.

The RJS library provides a server-side redirect_to for use with
prototype.js.  You might want to start there.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] call partial by jquery

2011-12-23 Thread Bill Walton
HI Bruno,

On Fri, Dec 23, 2011 at 11:01 AM, Bruno Meira goesme...@gmail.com wrote:
 Hi Guys,
 Sb could help me in this problem?
 I have an partial that I pass some parameters...
 I need to create many partials by click event of a link, How can I do that?

 I tried to do like this way
 But it does'nt work...

 $(#addContactLink).bind(click,
 function(){
 $(#partialtestdiv).append(%=render
 :partial='shared/user_contacts',:locals={:f=f},:object=resource.user_contacts
 %);
 }
 );

The onclick is executing in the browser so you're not going to be able
to use erb in it.  You'll want to make an ajax call (.load is a handy
shortcut for this) to the server where you can render the partial
using erb to get the html you need returned.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] call partial by jquery

2011-12-23 Thread Bill Walton
On Fri, Dec 23, 2011 at 11:12 AM, Bruno Meira goesme...@gmail.com wrote:
 H
 Ok, I will try do this using an ajax call...
 But How can I pass object references using an ajax call? Is it possible in
 rails or I need pass object attributes by JSON?

I believe that's what the 'data' argument of the .load function is
supposed to be used for.  Make a simple test using a string and see
what you get in the params hash on the server.

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] call partial by jquery

2011-12-23 Thread Bill Walton
On Fri, Dec 23, 2011 at 11:19 AM, Bill Walton bwalton...@gmail.com wrote:
 On Fri, Dec 23, 2011 at 11:12 AM, Bruno Meira goesme...@gmail.com wrote:
 H
 Ok, I will try do this using an ajax call...
 But How can I pass object references using an ajax call? Is it possible in
 rails or I need pass object attributes by JSON?

 I believe that's what the 'data' argument of the .load function is
 supposed to be used for.  Make a simple test using a string and see
 what you get in the params hash on the server.

If you're not already using them, I find both the Firebug and Live
HTTP Headers plug-ins indispensable for exploring ajax calls.

Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] call partial by jquery

2011-12-23 Thread Bill Walton
On Fri, Dec 23, 2011 at 12:08 PM, Bruno Meira goesme...@gmail.com wrote:
 Ok!!
 I will take a look better in these parameters.
 I'm using default chrome developers js debug. Is Firebug better?
 thx for the help ;D

I do all my dev work in Firefox because of the tools.  I hear Chrome
is catching up but don't have any experience there yet.

Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] ROR return JSON with 406 Not Acceptable error

2011-12-09 Thread Bill Walton
Hi Krisnaraj,

On Fri, Dec 9, 2011 at 4:05 AM, Krishnaraj KR
krishnaraj.ic...@gmail.com wrote:
 When we return JSON output using 'render :json =@profiles', the
 output will return the required results with a 406 error. How can
 avoid that 406 Not Acceptable error ?

This bit me yesterday.  You've told rails that you're going to respond
differently depending on what format the client requested by using
respond_to.  But then didn't tell rails what those response options
are.  You need to put a format block around the response.

 Function
 -
 def import
    #json= params[:data]
    @details = JSON.parse(json)
    @profiles = Profile.where(@details)
    respond_to do |format|
 format.js{
      puts(render :json =@profiles,:except =
 [:profileUpdatedDate, 
 :profileCreatedDate,:profileAddOrUpdate,:profileStatus]);
 }
    end
  end

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Determine Bank Name from Routing Number

2011-12-08 Thread Bill Walton
This has nothing to do with rails.  Google bank routing number list

On Thu, Dec 8, 2011 at 12:01 PM, Rails Learner li...@ruby-forum.com wrote:
 Hello,

 I am working on a project where we need to look up bank name (only
 US banks) from routing number. I will like to use something that is
 dynamic and has up-to-date information.

 Does anyone has suggestions on how to accomplish this?

 Thanks a lot in advance

 --
 Posted via http://www.ruby-forum.com/.

 --
 You received this message because you are subscribed to the Google Groups 
 Ruby on Rails: Talk group.
 To post to this group, send email to rubyonrails-talk@googlegroups.com.
 To unsubscribe from this group, send email to 
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/rubyonrails-talk?hl=en.


-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] cannot create child through association

2011-12-06 Thread Bill Walton
Before I call this a bug, would someone tell me if I'm missing something here?

Using 1.9.2 and 3.1.1... I can create a child if the relationship is
has_many, but not if the relationship is has_one.

rails new association_test
cd association_test

rails g model Poppa name:string
rails g model OnlyChild name:string poppa_id:integer
rails g model Kid name:string poppa_id:integer

rake db:migrate

class Poppa  ActiveRecord::Base
has_one :only_child
has_many :kids
end

class Kid  ActiveRecord::Base
belongs_to :poppa
end

class OnlyChild  ActiveRecord::Base
belongs_to :poppa
end

rails c  # ( linebreaks added for readability )

Loading development environment (Rails 3.1.1)
ruby-1.9.2-p290 :001  Kid
 = Kid(id: integer, name: string, poppa_id: integer, created_at:
datetime, updated_at: datetime)

ruby-1.9.2-p290 :002  OnlyChild
 = OnlyChild(id: integer, name: string, poppa_id: integer,
created_at: datetime, updated_at: datetime)

ruby-1.9.2-p290 :003  Poppa
 = Poppa(id: integer, name: string, created_at: datetime, updated_at:
datetime)

ruby-1.9.2-p290 :004  p = Poppa.create(:name = 'pops')
  SQL (24.4ms)  INSERT INTO poppas (created_at, name,
updated_at) VALUES (?, ?, ?)  [[created_at, Tue, 06 Dec 2011
14:18:54 UTC +00:00], [name, pops], [updated_at, Tue, 06 Dec
2011 14:18:54 UTC +00:00]]
 = #Poppa id: 1, name: pops, created_at: 2011-12-06 14:18:54,
updated_at: 2011-12-06 14:18:54

ruby-1.9.2-p290 :005  p.kids.create(:name = 'bob')
  SQL (0.7ms)  INSERT INTO kids (created_at, name, poppa_id,
updated_at) VALUES (?, ?, ?, ?)  [[created_at, Tue, 06 Dec 2011
14:19:29 UTC +00:00], [name, bob], [poppa_id, 1], [updated_at,
Tue, 06 Dec 2011 14:19:29 UTC +00:00]]
 = #Kid id: 1, name: bob, poppa_id: 1, created_at: 2011-12-06
14:19:29, updated_at: 2011-12-06 14:19:29

ruby-1.9.2-p290 :006  p.only_child.create(:name = 'sam')
  OnlyChild Load (0.4ms)  SELECT only_children.* FROM
only_children WHERE only_children.poppa_id = 1 LIMIT 1
NoMethodError: undefined method `create' for nil:NilClass
from 
/home/wildbill/.rvm/gems/ruby-1.9.2-p290@auction/gems/activesupport-3.1.1/lib/active_support/whiny_nil.rb:48:in
`method_missing'
from (irb):6
from 
/home/wildbill/.rvm/gems/ruby-1.9.2-p290@auction/gems/railties-3.1.1/lib/rails/commands/console.rb:45:in
`start'
from 
/home/wildbill/.rvm/gems/ruby-1.9.2-p290@auction/gems/railties-3.1.1/lib/rails/commands/console.rb:8:in
`start'
from 
/home/wildbill/.rvm/gems/ruby-1.9.2-p290@auction/gems/railties-3.1.1/lib/rails/commands.rb:40:in
`top (required)'
from script/rails:6:in `require'
from script/rails:6:in `main'
ruby-1.9.2-p290 :007 

Huh?  Any insight would be appreciated.  It's early here yet, so maybe
I just need a fresh cup.  Is this a bug?  My Google-fu doesn't seem to
be warmed up yet, cause I can't find anything.

TIA,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] cannot create child through association

2011-12-06 Thread Bill Walton
HI Colin,

On Tue, Dec 6, 2011 at 8:46 AM, Colin Law clan...@googlemail.com wrote:
snip

 ruby-1.9.2-p290 :006  p.only_child.create(:name = 'sam')
  OnlyChild Load (0.4ms)  SELECT only_children.* FROM
 only_children WHERE only_children.poppa_id = 1 LIMIT 1
 NoMethodError: undefined method `create' for nil:NilClass

 I think you have to use create_association for a has_one rather than create. 
 See
 http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html
 p.only_child returns a record (or tries to) and so cannot have a
 create method that does what you want.

Yep.  That was it.  Thanks.  If I think about it real hard and hold my
mouth just right it makes a little bit of sense ;-)

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: JOBS

2011-10-28 Thread Bill Walton
Peter,

Unless the rules have been changed, the requirement is that you
preface the subject line with [JOB] so that those who want to can
filter them out.

Best regards,
Bill

On Fri, Oct 28, 2011 at 3:04 PM, Peter Peter li...@ruby-forum.com wrote:
 Sorry I have just seen I can't post job ads. Sh8t I registered to
 attract interest from Ruby developers and thought it might be the place.
 Sorry

 --
 Posted via http://www.ruby-forum.com/.

 --
 You received this message because you are subscribed to the Google Groups 
 Ruby on Rails: Talk group.
 To post to this group, send email to rubyonrails-talk@googlegroups.com.
 To unsubscribe from this group, send email to 
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/rubyonrails-talk?hl=en.



-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Ruby adoption statistics

2011-10-07 Thread Bill Walton
Hi Andrew,

On Fri, Oct 7, 2011 at 1:34 PM, Andrew misbehav...@gmail.com wrote:
 Do you know where I can find articles/statistics on Ruby adoption

It's going to be difficult to get good data.  The biggest reason,
IMHO, is that companies that do adopt RoR are going to be doing so for
the productivity.  If it works, they're not going to talk about it.
That's what 'strategic advantages' are all about.  Keep your mouth
shut and hope your competitors don't figure it out.

If you're convinced that you need hard data then I'd recommend looking
for secondary indicators: growth of hosting providers is one.  How
many are there today vs. 2 years ago.  Do they say anything about
customer base?  What about financial condition?  There are tertiary
indicators as well.  Of those hosting providers, how many moved into
new digs this year?  They moving up?  Or scaling back?  I doubt very
seriously that the leg-work will pay off (see below for why) but it
would be an interesting exercise.  If you do undertake it, I'm sure
you'll be able to find a publisher who'll pay you a small amount (way
out of proportion if you do the per-hour calculation, so don't ;-) )
to publish it.

 and how I can convince my co-worker(s) that Ruby is the way to go?

You probably can't 'convince' them.  The choice isn't so much rational
as it is personal preference.  There are, IME, two ends to the
programmer-preference spectrum:  Java and Rails.

The spectrum is most easily characterized by the individual's
tolerance for delay in the gratification / feedback loop.  I liken the
Java end to the guys who build the huge, elaborate domino knock-down
displays.  Please understand that I am not criticizing at all; simply
making an observation on human nature.  The domino guys get a big dose
of gratification when the dominoes all fall.  But it's not about the
dominoes falling.  It's about the validation that all the setup steps
were done perfectly.  It's the validation that counts.  If the
dominoes all fell because the ground shook, there'd be no joy.

So if I were you (embarked on organizational change) I'd ignore the
developers who've already expressed a preference for Java.  Focus on
the ones that may be more attracted to a rapid-feedback model.
Introduce them gently; perhaps via your local ruby brigade.  Get them
around some folks who are clearly having more fun than them.  In any
event, they'll get some free pizza ;-)

Good luck and best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] actual request-received time?

2011-09-03 Thread Bill Walton
There are a number of 'layers' a request must pass through before it
actually 'hits' a Rails app (e.g., Apache receives a request, Apache
starts a new thread, new thread processes the request and determines
that it's for a dynamic resource so Apache thread passes it to
Passenger, Passenger passes it to or starts a new Rails process, Rails
app begins processing request. ...)  Does anyone know if / how it's
possible to get at the actual time a request hit the first software
layer on the server ?

Thanks,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Using timezone javascript to set Time.zone

2011-07-13 Thread Bill Walton
Hi Ben,

On Wed, Jul 13, 2011 at 9:47 AM, Ben Perry b3npe...@gmail.com wrote:
 I've got a javascript that provides me with the timezone for the
 client. I want to use this to set Time.zone so that all my times
 stored in the database are displayed in the timezone for the client.
 So really simplistically

 var timezone = jstz.determine_timezone().timezone
 Time.zone = timezone.olson_tz

 obviously this can't be done. I've taken a look on the web and can
 only find 'solutions' over two years old and as ROR moves so fast I
 thought someone may know of a better solution. So can anyone suggest a
 simple solution?

It needs to be set on the server.  You could do an AJAX call.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] is Rack right for this?

2011-07-11 Thread Bill Walton
Greetings,

My 2.3.2 app has 2 components.  It serves a browser-based client, and
it serves a web service client.  Each client has its own set of
controllers to separate authentication / authorization cleanly and
clearly.  The web service client sends gets, posts, and puts, some
with xml bodies, and the app responds with status / location and xml
bodies where appropriate.  I'm in the beginning stages of moving the
app to Rails 3.  One thing I'd like to accomplish is to reduce the
start-up overhead associated with the web service requests if
possible.  I really don't need / use the erb functionality in
constructing the responses, for example.  The thing I don't have my
arms around at this point is how to get the controller and model
'stuff' loaded without the bulk of the view 'stuff'.'  Anybody got any
experience / insight to share.  I don't seem to have my google fu in
order.

Thanks,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Filters

2011-06-05 Thread Bill Walton
Hi Fernando,

On Sun, Jun 5, 2011 at 3:59 PM, Fernando Aureliano
m...@fernandoaureliano.com wrote:
 Hi,
 How I do a filter in a block of code?
 example:
 I have a block:
 % @notes[(0..3)].each do |note| %
   % if notes.type.class == String %
           li
             %= notes.note %
             %= notes.type %
           /li
  % end %
 % end %
 Type is a string, I would like to do a block filtering by a value on type.

However, your code will be much more testable if you do the filtering
on @notes in the controller, or even better, by writing a method in
your model that only returns records with type of class String.


HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] trying to get z-index to work - CSS styling with RJS

2011-05-31 Thread Bill Walton
Hi Jedrin,

On Tue, May 31, 2011 at 5:22 PM, Jedrin jrubia...@gmail.com wrote:
  I have a section of controller code that tries to style a page with
 moving text and images.
 This used to work a few years ago, but I have not had the site working
 for awhile and I am trying to resurrect it.
 Below is some of the RJS code. The z-index and font-size does not seem
 to work as far as I can tell, though I am especially focused on z-
 index not working. My moving text is supposed to be in front of the
 images, but it is not.
 If I do view generated source from web developer plugin, one of the
 elements generated is shown below. I am not sure if my problem may be
 something different in RJS or CSS is needed or what else I can try to
 troubleshoot the problem ? I am using rails 3.0.5 at the moment ..
 thanks

Another possibility, if Walter's suggestion doesn't lead to a
solution, is that the different behavior you're seeing now vs. then
has to do with browser 'maturation.'  I believe most current browsers
will give precedence to the stylesheet over inline styling.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] is there something peculiar about a render :update block ?

2011-05-31 Thread Bill Walton
Hi Jedrin,

On Tue, May 31, 2011 at 5:11 PM, Jedrin jrubia...@gmail.com wrote:

  When doing RJS stuff of the form below, I seem to recall unexpected
 behavoir where if I had many method calls within that block things
 didn't work as expected and variables would not have values I
 expected. I know I am not being very specific and I don't have an
 example. I am trying to refactor some code where I have alot of code
 inside the block and I am affraid I am going to have the same sort of
 problem I used to have previously when I had written alot of RJS stuff
 previously.

  render :update do |page|
     ...
  end

I tend to use render :update from within the controller in cases where
there are a small number (like 4 max) of method calls.  Beyond that, I
think it improves readability and testability to move the method calls
to an rjs template.

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] trying to get z-index to work - CSS styling with RJS

2011-05-31 Thread Bill Walton
On Tue, May 31, 2011 at 5:48 PM, Walter Davis wa...@wdstudio.com wrote:

 On May 31, 2011, at 6:32 PM, Bill Walton wrote:

  I believe most current browsers
 will give precedence to the stylesheet over inline styling.

 Sorry, I disagree with this. The stylesheet is given the same priority as
 ever, in keeping with the idea of weight inherent to the cascade. The
 closer a declaration is to the thing that it governs, the more authoritative
 it is taken to be.


I stand corrected.  Thanks.

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: trying to get z-index to work - CSS styling with RJS

2011-05-31 Thread Bill Walton
On Tue, May 31, 2011 at 6:25 PM, Jedrin jrubia...@gmail.com wrote:

 I tried this and I seem to still have the same exact problem:

Another resource that's incredibly helpful, in case you don't already
subscribe, is the css-discuss list.  It's run by Eric Meyer and is a
how-do-i-do-or-fix-this-thing list. The name is a little misleading.
There's no opining.  Post your objective, your code or a link to a
page with the problem, and you will get very specific instruction on
how to achieve your goal.

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] is polymorphic has_one/has_many possible? (in addition to polymorphic belongs_to)

2011-05-06 Thread Bill Walton
Hi Alexey,

On Fri, May 6, 2011 at 5:21 AM, Alexey Muranov li...@ruby-forum.com wrote:
 Hello,

 i wonder if the following is possible in Rails (seems like not), and if
 not, whether such database structure is discouraged for some good
 reason.

 I *roughly* want to have

  class Payment  ActiveRecord::Base
    has_one :purchase
  end

 where purchase can be either TicketPurchase, or MembershipPurchase, so
 to have also

  class TicketPurchase  ActiveRecord::Base
    belongs_to :payment
  end

  class MembershipPurchase  ActiveRecord::Base
    belongs_to :payment
  end

Depending on your constraints, i.e., whether or not you have control
of the schema, you might flip the association.

class TicketPurchase  ActiveRecord::Base
  has_one :payment   # this could just as easily be a has_many if you
need to support split tenders
end

class MembershipPurchase  ActiveRecord::Base
  has_one :payment
end

class Payment  ActiveRecord::Base
  belongs_to :ticket_purchase
  belongs_to :membership_purchase
end

Alternatively, or perhaps in addition, the purchase hierarchy your
explanation touches on looks like a pretty classic use-case for STI
(http://martinfowler.com/eaaCatalog/singleTableInheritance.html)

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Performance question about ruby/rails

2011-04-28 Thread Bill Walton
Hi Ken,

On Thu, Apr 28, 2011 at 9:39 AM, egervari ken.egerv...@gmail.com wrote:
 I have a program I'd like to write and I'd like to get off of Java and
 start using something more productive. I have played around with
 Rails, and I think I could the same app in a fraction of the time.

Welcome!  I think you wouldn't have to look far to find any number of
ex-Java developers on this list who could provide you with personal
experience supporting your thinking. ;-)

 There's one part of the app though that I am not if Rails/Ruby would
 be a good fit... so I'd like to get some expert advice on this one
 portion.

 There's one part of the application that needs to check a thesaurus
 about 100 or 200 times per request. There might be a lot of these
 requests. There is also a grammar checker that is going to be used
 (although I need to find one that works with Ruby).

 I can imagine that these are some very expensive requests. In the java
 world, I can simply put the thesaurus and grammar checker (with rules)
 entirely in memory as Java beans in a spring container. When the app
 starts up, we initialize these two services and they just stay in
 memory, waiting for requests.

I, too, will recommend a hybrid approach, though I suggest looking at
an IMDB approach to the shared thesaurus.  Here's a link to one
approach that looks ready-made for integration with a RoR app.
http://www.themomorohoax.com/2009/03/15/activerecord-sqlite-in-memory-db-without-rails

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Performance question about ruby/rails

2011-04-28 Thread Bill Walton
On Thu, Apr 28, 2011 at 7:10 PM, Andrew Miehs and...@2sheds.de wrote:
 On Fri, Apr 29, 2011 at 1:25 AM, radhames brito rbri...@gmail.com wrote:


 So if I use memcached, the memory would be used up multiple times?


 nop, what is more awesome is that you can pass an ip (or an array) to the
 config and it will use  that (those) server's memcached so in the future
 scaling your app is just a matter of putting the memcached  server on
 another box(check the doc to find out how easy is to cluster) and restarting
 your web server, it would take you 3 minutes

 Memcached is a simple server process that stores a hash - if thats all you
 need, that would definitely be the easiest solution.

Agreed.

My initial recommendation was based on the assumption that you're
going to need to store the data somewhere and a db is, to me, the
logical place for it.  So, to me, memcached is a second step, not a
first.  YMMV.

To answer your earlier question about multiple database connections,
it can be as simple as adding an entry for it to database.yml and a
before_filter in application.rb to establish a connection to same for
every Rails instance.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] [JOBS] Technical writer familiar with Rails and documenting a RESTful API

2011-03-26 Thread Bill Walton
Hi Steve,

Thanks for asking.  I've engaged someone who I think is going to work
out.  If not, I'll give you a shout.  Are you interested in some side
work in general?  If so, there's always stuff that needs to be done
that's important but not urgent enough to get my personal attention
that I'd like help with and can sometimes find budget for.  Let me
know.

Thanks,
Bill

On Sat, Mar 26, 2011 at 2:45 PM, steve ross cwdi...@gmail.com wrote:
 Any luck with this, Bill? I might be able to do it if the specifics are 
 right...

 Steve Ross


 On Feb 28, 2011, at 7:12 AM, Bill Walton wrote:

 I have a short-term contract position opening for a technical writer.
 The position is telecommute and is probably a week to 2 weeks worth of
 work at full time.  Part-time can be accommodated.  Pay rate is
 negotiable.  If you're experienced and interested, please contact me
 at bill at shopkeep dot com.

 Thanks,
 Bill

 --
 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 from this group, send email to 
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/rubyonrails-talk?hl=en.


 --
 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 from this group, send email to 
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/rubyonrails-talk?hl=en.



-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: production server on passenger - showing all items in public folder

2011-03-21 Thread Bill Walton
Hi Jason,

On Mon, Mar 21, 2011 at 10:17 AM, jason white jasonwhite...@gmail.com wrote:
 the load module is on one line

 i'm assuming that Passenger is loading, but not 100% sure how to
 check. How can I pull up the log files?

Easiest way to see if Passenger is running is ps -eaf

You should see a couple of lines in the list like those below if it is.

root 18386  3685  0 Mar20 ?00:00:01
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/ext/apache2/ApplicationPoolServerExecutable
0
root 18387 18386  0 Mar20 ?00:00:00 Passenger spawn server

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] obfuscating sensitive data

2011-03-07 Thread Bill Walton
On Mon, Mar 7, 2011 at 12:44 PM, Fearless Fool li...@ruby-forum.com wrote:
 In our app, users give us sensitive information (credentials for
 logging into a third party site).  At some point, we need those
 credentials in cleartext in order to access the third party site, but
 while they're in our database, we want to make best effort for
 protecting them.

 What techniques have people used for this?  I find myself asking WWMD
 (What Would Mint.com Do?) -- any suggestions?

You might find the ezcrypto gem helpful.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] redesigning a php app

2011-03-01 Thread Bill Walton
Hi Kenneth,

On Tue, Mar 1, 2011 at 5:48 PM, Kenneth Vogt kenneth.v...@gmail.com wrote:
 I am redesigning a php app in RoR. I am brand new to both Ruby and
 Rails. There is a front end to the app with the typical MVC kind of
 interactions between end users and a database. There is also backend
 processing that happens independent of any user interaction. My
 question is, does the RoR framework make any sense for this backend
 processing seeing as there wouldn't really be any views? I don't
 want to code in two languages unnecessarily but I also don't want to
 force something into a mold for which it is not designed. Does RoR for
 backend processing make sense? If not, what does?

My short answer is yes.  My current app provides two sorts of what I
think you mean when you say 'backend processing.'  script/runner gives
us access to the Rails app outside the 'interactive user' model.

In the first case there a user requests a report.  That request is
queued via the Background job plugin.  When the Background job runs,
it

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] redesigning a php app

2011-03-01 Thread Bill Walton
Oops.  Continuing...

On Tue, Mar 1, 2011 at 6:08 PM, Bill Walton bwalton...@gmail.com wrote:
 Hi Kenneth,

 On Tue, Mar 1, 2011 at 5:48 PM, Kenneth Vogt kenneth.v...@gmail.com wrote:
 I am redesigning a php app in RoR. I am brand new to both Ruby and
 Rails. There is a front end to the app with the typical MVC kind of
 interactions between end users and a database. There is also backend
 processing that happens independent of any user interaction. My
 question is, does the RoR framework make any sense for this backend
 processing seeing as there wouldn't really be any views? I don't
 want to code in two languages unnecessarily but I also don't want to
 force something into a mold for which it is not designed. Does RoR for
 backend processing make sense? If not, what does?

 My short answer is yes.  My current app provides two sorts of what I
 think you mean when you say 'backend processing.'  script/runner gives
 us access to the Rails app outside the 'interactive user' model.

In the first case there a user requests a report.  That request is
queued via the Background job plugin.  When the Background job runs,
it creates the report and then emails it to the requester.

In the second case, we have cron jobs that also call script/runner to
do nightly database maintenance; removing accounts that have been
canceled, etc.

If you've got a specific case you're wondering how you'd handle, feel
free to ask about it.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] [JOBS] Technical writer familiar with Rails and documenting a RESTful API

2011-02-28 Thread Bill Walton
I have a short-term contract position opening for a technical writer.
The position is telecommute and is probably a week to 2 weeks worth of
work at full time.  Part-time can be accommodated.  Pay rate is
negotiable.  If you're experienced and interested, please contact me
at bill at shopkeep dot com.

Thanks,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Call Rest webservice in Ruby on Rails

2011-02-28 Thread Bill Walton
I use the Ruby Net::HTTP library to construct requests.

Best regards,
Bill

On Mon, Feb 28, 2011 at 10:03 AM, gs84 salimat...@gmail.com wrote:
 Hi every body,

 I use rest web service in my rails application for user's
 authentication (user creation, login, ...)
 Can someone explain me, how can i call a REST Web service  (not
 developped in Rails, and deployed by Tomcat) in my rails application
 via POST method.

 Thanks in advance for your help

 --
 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 from this group, send email to 
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/rubyonrails-talk?hl=en.



-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] validates_format_of :phone with = /^\([0-9]{3}\)[-. ]?[0-9]{3}[-. ]?[0-9]{4}|^[0-9]{3}[-. ]?[0-9]{3}[-. ]?[0-9]{4}$/

2011-02-18 Thread Bill Walton
Hi Victor,

On Fri, Feb 18, 2011 at 7:03 AM, Victor S victor.s...@gmail.com wrote:
 To be a bit more clear about how I see the problem: as I said
 earlier, http://www.rubular.com/  validates the correctness of the
 expression, I've tried similar expressions in JS parsers, .NET parsers,
 Python parsers, they all pass, I think it's the rails parsers that fails,
 and/or something about the validates with that doesn't like the
 parenthesis... can someone prove me wrong? Please?

It might be that, in Ruby, ^$ match before / after newlines, not
beginning / end of string.  Give it a try with \A and \Z and see if
that solves it.

HTH,
Billl

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Handling InvalidAuthenticityToken from bots

2011-02-17 Thread Bill Walton
HI Paul,

On Thu, Feb 17, 2011 at 9:01 AM, paul p...@nines.org wrote:
 I'm using exception_notifier to get an email when a 500 error occurs
 in production. Lately I'm seeing a lot of nonsensical POSTs show up
 that cause an InvalidAuthenticityToken error. All the fields contain
 random characters. (For instance,  search_title=BHQWTZpjGeb)

 Is there a way to detect them and not send the email, while still
 sending the email in all other cases? I don't want to get used to
 these emails and miss one that is an actual bug in production.

I'm not sure what the interplay with the exception_notifier would be
but a rescue_from before filter will let you specifically handle the
InvalidAuthenticityToken exceptions.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] rails hoster recommendation

2011-02-04 Thread Bill Walton
You might want to take a look at using Amazon Web Services' EC2 and/or S3.

Best regards,
Bill

On Fri, Feb 4, 2011 at 3:10 PM, frankblizzard tmaxim...@googlemail.com wrote:
 hi,

 i work in a small web development company and we just finished some
 first applications using rails, before it was php all the way.
 now our actual hoster doesnt offer rails so we need another one only
 for the rails projects.
 i wonder if anyone can recommend a good rails hoster?
 its mostly smaller apps but with a lot of images / videos so a lot of
 diskspace at a reasonable price would be awesome ;)
 i am in germany, so probably a european hoster would be preferred.
 thanks for your help

 --f

 --
 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 from this group, send email to 
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/rubyonrails-talk?hl=en.



-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] jQuery vs Prototype re: Rails' helpers

2011-01-06 Thread Bill Walton
I'm considering switching from Prototype to jQuery but wonder...  do
the Rails helper methods like form_remote_tag and button_to_remote
work with jQuery 'out of the box' ?

I've got 2 apps I'd need to convert: one on 2.1.1 and the other on 2.3.2

TIA,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] background jobs , comparison esp for sending emails

2010-12-12 Thread Bill Walton
I'm using Background Job to send emails with the same objective.  It's
working well.,

HTH,
Bill

On Sun, Dec 12, 2010 at 8:50 AM, tramuntanal tramunta...@gmail.com wrote:
 You can follow engine yard
 recomendations: http://www.engineyard.com/products/technology/stack
 explore: http://github.com/ezmobius/nanite
 or use raw cron
 I advice that EngineYard recomendation against backgroundrb is realy true. I
 had to remove backgroundrb from a production app (not hosted in EngineYard)
 and use raw crons because the background server failed a lot.
 Regards

 2010/12/10 tom tomabr...@gmail.com

 hi, im new to backgroundjobs etc. a quick look revealed a lot of options.
 is there any kind of comparsion out there? im looking into this coz i have
 a lot 'notification emails' triggered by observers which i kinda want to
 exclude from the workflow and pass it on into a 'mail' queue or similar.

 any ideas if there is a comparison etc out there?

 thx
 tom

 --
 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 from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.



 --
 
 Oliver Hernàndez Valls

 http://www.negocis.cat
 http://wiki.tramuntanal.cat
 http://sourceforge.net/projects/windsofscrum/

 --
 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 from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.


-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Moving View Logic into Controller

2010-11-24 Thread Bill Walton
Hi Andrew,

On Wed, Nov 24, 2010 at 11:59 AM, Andrew Davis li...@ruby-forum.com wrote:
 Hello,

 Rails Best Practices is telling me to move some code from one of my
 helper views into the controller. I was hoping to get some assistance as
 I'm unsure how to do this and still have the application work.

 The helper: http://pastie.org/private/pfub9iklus5ajuu1iwvfza

 The report says I need to move the second and third lines into the
 controller, but if I do that, how does the rest of the code know how to
 work?

Do your finds in the controller, assigning the results to instance
variables, and then access the instance variables in the view.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Moving View Logic into Controller

2010-11-24 Thread Bill Walton
On Wed, Nov 24, 2010 at 12:35 PM, Andrew Davis li...@ruby-forum.com wrote:
 Since I'm still learning, here is my attempt, is this what you are
 trying to say?

 http://pastie.org/private/hiqrzql2zb4qv5gr1drpa

 I think I understand what you're saying, just not sure if I'm doing that
 correctly.

Yes.  That's it.  Do your best to keep logic out of the views.  It
will make your application more testable.  The selection of data sets
is one type of logic.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Moving View Logic into Controller

2010-11-24 Thread Bill Walton
On Wed, Nov 24, 2010 at 1:03 PM, Andrew Davis li...@ruby-forum.com wrote:
 Thank you very much Bill for your assistance, it is greatly appreciated
 :)

You're welcome, Andrew.  Welcome to the Rails community.

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Moving View Logic into Controller

2010-11-24 Thread Bill Walton
On Wed, Nov 24, 2010 at 2:05 PM, Andrew Davis li...@ruby-forum.com wrote:
 Bill, that doesn't seem to be working. It seemed to be at first until I
 tried to do more with the application.

It's working just fine.  The error message is telling you that
@all_task_orders is nil.  You just have to figure out why.  The fact
that it is created in the controller makes it easier to debug.
Execute the commands in your index method from the console (ruby
script/console) and see what they return.

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] RJS Page Object

2010-11-23 Thread Bill Walton
Hi Kevin,

On Tue, Nov 23, 2010 at 2:27 PM, kevin lee li...@ruby-forum.com wrote:
 I am struggling to understand and find resource to learn what parameter,
 if that is the right word, can be inside the brackets in the page
 statement for visual effect, i.e.

The id of a DOM element.  And remember that id must be unique.  The
W3C validator can be a real timesaver.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Need help writing about Rails in magazine article

2010-11-06 Thread Bill Walton
Hi Tony,

On Sat, Nov 6, 2010 at 6:33 AM, Tony Maserati ableton...@gmail.com wrote:
 Hi. I'm trying to write about Rails for this magazine article. How
 does it look so far? I'm trying to explain it to the average man - NOT
 the developer.

 Rails is a system which drastically simplifies web applications - by
 letting one develop using Ruby [1], by having a more reasonable way of
 organizing things [2], and by automating a lot more [3]. Rails also
 opens the door for failsafe applications by writing tests and then
 making sure the application passes these tests [4]

 [1] Perl, Lisp and Smalltalk. [2] In conjunction with semantic, W3-
 verified HTML and CSS, and JavaScript via jQuery. [3] I.e. database
 management. [5] Behavior Driven Development via Cucumber.

 Anything I should add, rephrase or take away? Especially [3], is there
 anything I could add there?

I'd start by trying to define the things this 'average man' cares
about and then talk about those things.  I don't see anything above
that would have meaning / value for anyone _but_ a developer.  You
might want to start with something like cost.

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Log shifting error

2010-11-01 Thread Bill Walton
Hi Peter,

On Mon, Nov 1, 2010 at 6:43 AM, Peter Hickman
peterhickman...@googlemail.com wrote:
 Once again, here in the UK, we have had our switch back from summer
 time saving and once again various applications failed for things like

 /usr/local/lib/ruby/1.8/logger.rb:501:in `write': Shifting failed.
 '/.../log/poll_sportsdb_for_updates.log.20101031' already exists.
 (Logger::ShiftingError)

Are your servers running local clocks or UTC?  We're shifting next
week and I hadn't anticipated a problem but now that you bring it up I
wonder if I've missed something.  Our servers are running UTC.

Thanks,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Log shifting error

2010-11-01 Thread Bill Walton
On Mon, Nov 1, 2010 at 7:32 AM, Peter Hickman
peterhickman...@googlemail.com wrote:
 I'm pretty sure that our server are running local time and not UTC
 (which would be a sure fix - I think).

Ok.  Thanks.

 Not really sure that I would feel confident changing to UTC for nearly a dozen
 servers located on two continents.

You have a knack for understatement ;-) At a minimum it would wreak
havoc with your reporting apps which invariably use the system
date/time to grab the 'right' records.

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Nested form, perhaps?

2010-10-14 Thread Bill Walton
Hi Walter,

On Thu, Oct 14, 2010 at 7:46 AM, Walter Lee Davis wa...@wdstudio.com wrote:
 I have a general design question, and haven't written any code for this
 feature yet. I'm setting up a control panel for a sort of team/content
 management system. A new project needs a team to work on it. The project has
 been saved, so we don't have to worry about that. But each member of the
 team needs to have a role in relation to this project (they may have another
 role on a different project). So I am thinking about using a
 has_many_through relationship between projects and people using a Role
 model.

Seems to me you might benefit from introducing a Team
model/controller/view stack to manage the assignment of People and
their Roles.

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Writing a Report on Ruby on Rails - Could anyone provide any insight

2010-10-14 Thread Bill Walton
Hi Josh,

On Thu, Oct 14, 2010 at 6:55 AM, Josh Nathan tod.oder.e...@gmail.com wrote:
 We have been ask about how Ruby on Rails could be intergrated into a 3-
 tier architecure for produce a single intergrated source of student
 data and information. It would included both adminstrative and public
 records etc.

Who is 'we'?  If you're, for example, a team within a university IT
function that's considering Rails you'll find much better response
here that if you're an IT consultancy.

 Any information on how Ruby on Rails could be used in this sense
 sucesfully would be of great use, as well as information on how it
 could be intergrated with an Oracl Database.

Rails is very good at database-backed, front-end driven web
applications.  So if by 'single integrated source' you mean a single
view into multiple databases, then Rails is well suited for your
purpose.  If on the other hand, your talking about using Rails to
manage a federated system, probably not so much.

Say more about who you and and what you're trying to accomplish.

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Need advice on controller / view

2010-10-11 Thread Bill Walton
Hi Christian,

On Mon, Oct 11, 2010 at 10:33 AM, Christian Fazzini
christian.fazz...@gmail.com wrote:
 I was also thinking. Both actions should still call artists#index.
 In artist#index, I'll have an if condition that checks which template/
 view to render.

 Is this a sensible approach?

 On Oct 11, 11:29 pm, Christian Fazzini christian.fazz...@gmail.com
 wrote:
 Need some advice. I've got two modules: artists and paintings.

Do you mean controllers?  Or do you mean modules?  For purposes of
this reply I'm assuming you mean controllers.


 In my home page, I've got a 2nd page that says Browse paintings,
 which displays ALL paintings of ALL artists. This is being rendered by
 paintings#index.

 In another page, I should show all paintings of a specific artist
 ONLY. Meaning, paintings from ONE artist. I cant use paintings#index
 for this anymore since it is already being used by the homepage. Also
 take note, both pages are rendered differently (meaning, data and
 display are not the same). They don't look alike. So I can't use index
 for both pages.

 What approach would you take?

 I am thinking of creating a method in the artists module called:
 list_paintings. And then in /app/views/list_paintings.html.erb

 What are your thoughts?

The typical approach would be to add a list method to your controller.
 The default action of the index method is typically to list all
records, while a list method typically takes parameters used to filter
the returned records.  Assuming that you want to remain as RESTful as
possible, use list to return your 'list by artist' page.  List is a
RESTful method.  Index is not.  It's simply a method that's 'required'
in terms of normal web page naming.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Need advice on controller / view

2010-10-11 Thread Bill Walton
Hi Erol,

On Mon, Oct 11, 2010 at 10:45 AM, Erol Fornoles erol.forno...@gmail.com wrote:

Your routing suggestion is good, however this
 �...@artist = Artist.find(params[:artist_id])

will throw an exception if params[:artist_id] is not supplied.  You
could avoid that using Artist.find_by_id which should return nil
rather than throwing a RecordNotFound exception.  At the same time, it
is not typical for an index method to be called with parameters.  More
typical to simply supply a list method for that purpose and include it
in your routes.

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] ruby on rails programmer/developer

2010-10-07 Thread Bill Walton
Hi Jon,

On Thu, Oct 7, 2010 at 7:52 AM, Revolution Man
jonathan.dalto...@gmail.com wrote:
 I have acquired a new online web company that was programmed in Ruby
 on Rails and I am having a very difficult time finding anyone who
 writes or works with this language to fix some minor issues and add
 some major features.  I live in the Boston area.  Any ideas where I
 can start looking for a dependable and competent Ruby developer?  Any
 help would be much appreciated.

A good starting point would be the local Ruby Brigade.  The Boston
area group appears to be pretty active.  Info and contacts at
http://bostonrb.rubybrigade.org/

There are several online sites that specialize in Ruby on Rails
positions.  Google 'Ruby on Rails jobs' and you'll see where
developers may be going to look for work.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] ruby on rails programmer/developer

2010-10-07 Thread Bill Walton
On Thu, Oct 7, 2010 at 8:59 AM, Jonathan Dalton
jonathan.dalto...@gmail.com wrote:
 thanks alot Bill

You're welcome.  And best of luck with your new venture!

Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Cronjob in Rails?

2010-10-04 Thread Bill Walton
Hi Rodrigo,

Why don't you just use cron?

Bill

On Mon, Oct 4, 2010 at 1:22 PM, rodrigo3n rodrig...@gmail.com wrote:
 Hello everyone, I have to develop a cronjob in my app, it should run
 automatically every 2 hours, is there a way of doing it simply
 creating a rake task? I don' t know how could I set the interval time
 for it. Do you know? Please help!

 Rodrigo Alves Vieira

 http://rodrigo3n.com

 --
 You received this message because you are subscribed to the Google Groups 
 Ruby on Rails: Talk group.
 To post to this group, send email to rubyonrails-t...@googlegroups.com.
 To unsubscribe from this group, send email to 
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/rubyonrails-talk?hl=en.



-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: [JOBS] Calling all Alpha Males with Ruby on Rails!

2010-09-25 Thread Bill Walton
Hi Kathleen,

On Sat, Sep 25, 2010 at 11:22 AM, Kathleen Griffiths gr...@sg.com wrote:
 Well, maybe I am wrong,

Nah.  By definition Alpha Females don't need defending.  Alpha Males
know that.  Betas, not so much ;-).

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Need an online payment system - suggestions required

2010-09-11 Thread Bill Walton
Hi,

On Sat, Sep 11, 2010 at 3:22 AM, tonypm tonypmar...@hotmail.com wrote:


 On Sep 6, 3:52 am, Christian Fazzini christian.fazz...@gmail.com
 wrote:
 Hello all,

 We are about to launch our site. One of the features that is missing
 at the moment is a way for users to fill in their credit card details
 and click send to purchase our products that we offer on our website.

 We are relatively new to this concept, so we do not know where to
 start? I am guessing we have to open up a merchant account? Is this
 the right term? Or Is it an online gateway payment system?

 So far, I've come across the following: Braintree, PaySimple,
 TrustCommerce, BeanStream, Shopify, Authorize.net

 Ive also come across a plugin called ActiveMerchant, which, I assume
 handles the interface to send data to whichever merchant account I end
 up signing with. Is this correct?

 What should I look for when considering one of the above services?
 Fees? Processing fee per transaction? Monthly billings, etc?

 Any additional information will be appreciated.


 This question interests me too.  Strange not to have got any response
 to this- I wonder how many people have actually implemented a payment
 gateway on a rails site  - it doesn't seem to appear in posts lately..

The situation with regard to taking credit card payments has changed
substantially, perhaps fundamentally is a more accurate word, in the
last year.  Long-story-short, your best option is to get set up with a
Payment Gateway that will handle your interactions with Payment
Processor(s).  If you Google 'credit card payment gateway' you will
find many.

The change that has taken place results from legislative action
responding to system breaches that have resulted in credit card info
being compromised.
(http://www.google.com/search?q=credit+card+breach+statistics)

What has emerged is a 'system' wherein your site never sees the actual
credit card information that the user enters.  It gets submitted
directly to the Payment Gateway which passes it to the Payment
Processor and then passes the response back to you along with a
'token' for that credit card which you can use to make charges against
it for future purchases.  The token is only recognized as valid by the
Payment Gateway if it comes from your system.  What that means is that
you are not storing anything that could be used by someone who broke
into your system.  You have no credit card info, and the tokens aren't
usable by any system but yours.

My experience with this began about a year and a half ago.  The
company I work for sells a SaaS POS system that provides our customers
with the ability to take credit cards.  The Payment Processor we
initially talked to told us that we needed to either go the Payment
Gateway route (which they strongly recommended) or to get ready to
spend around $50K, not counting our time, for a PCI audit /
certification.  In order to deal directly with Payment Processors you
now must be certified as PCI-compliant.

If you need more help, particularly with respect to the 'what should I
look for ...' question, I'd be happy to offer it off-line as this
really has nothing at all to do with Rails.  You can reach me at the
work email address below.

Best regards,
Bill
bill AT shopkeep DOT com

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Whats a good way to avoid nil lookup errors

2010-09-05 Thread Bill Walton
Hi Christian

On Sun, Sep 5, 2010 at 9:38 AM, Christian Fazzini
christian.fazz...@gmail.com wrote:
 So this would be the convention right? not by using rescue_from. Is
 this right?

Yes.  When possible, avoid begin-rescue by using Ruby / Rails to
return a value you can handle within the normal course of your
application logic.  It makes for more readable code.

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] find created_at in local time

2010-09-02 Thread Bill Walton
Hi Sven,


On Thu, Sep 2, 2010 at 1:13 AM, Sven Koesling li...@ruby-forum.com wrote:

 Can You tell me what would be the correct solution to translate?

 In addition to Chris' recommendations, you should check out the Rails
ActiveSupport::CoreExtensions helpers like .beginning_of_day and
.end_of_day methods which, IMHO, are more readable than using
:advance.  
(http://as.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Date/Calculations.html)

I'd also recommend the TZInfo library (http://tzinfo.rubyforge.org/)
if you're going to need to do reporting of this sort for clients in
more than one timezone.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Multipart email - HTML document files

2010-08-31 Thread Bill Walton
Hi,

On Tue, Aug 31, 2010 at 5:34 AM, Pale Horse li...@ruby-forum.com wrote:
 Pale Horse wrote:

 What I want, and can't seem to achieve, is to send an html email with an
 attachment. As it stands, I can do one or the other and aren't sure how
 to get both to work.

http://api.rubyonrails.org/classes/ActionMailer/Base.html

I suspect the answer to your problem lies in the last sentence of the
'Multipart Emails' section which says:

Implicit template rendering is not performed if any attachments or
parts have been added to the email. This means that you’ll have to
manually add each part to the email and set the content type of the
email to multipart/alternative.

The latter portion of the 'Mailer Models' section addresses explicit
template rendering.  Googling 'rails mailer explicit template
rendering' offered up some links that look helpful.  There's one by
Eric Hodel that looked like it might point the way.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] b tag in HTML 5 (was Re: Re: assert_select for pbtext/bvalue/p)

2010-08-30 Thread Bill Walton
On Mon, Aug 30, 2010 at 11:24 AM, Greg Donald gdon...@gmail.com wrote:
 On Mon, Aug 30, 2010 at 11:18 AM, Marnen Laibow-Koser
 li...@ruby-forum.com wrote:
 I didn't say it was invalid HTML.  I said it was *bad practice*.

 Yeah, that's why it's in the spec, 'cause no one should use it.

 /rolls eyes

+1.  If only marnen were in charge  ;-)

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: b tag in HTML 5 (was Re: Re: assert_select for pbtext/bvalue/p)

2010-08-30 Thread Bill Walton
On Mon, Aug 30, 2010 at 2:19 PM, Robert Walker li...@ruby-forum.com wrote:
 Marnen Laibow-Koser wrote:
 Bill Walton wrote:
 On Mon, Aug 30, 2010 at 11:24 AM, Greg Donald gdon...@gmail.com wrote:
 On Mon, Aug 30, 2010 at 11:18 AM, Marnen Laibow-Koser
 li...@ruby-forum.com wrote:
 I didn't say it was invalid HTML. �I said it was *bad practice*.

 Yeah, that's why it's in the spec, 'cause no one should use it.

 /rolls eyes

 +1.  If only marnen were in charge  ;-)

 The HTML 5 spec itself says b is only to be used as a last resort if
 no other element is more appropriate.  IMHO, that's never the case: even
 if nothing more specific can be found, span is more appropriate than
 b.

 I have to agree with Marnen. Are we criticizing people for emphasizing
 exactly what the HTML5 spec states now?

Speaking for myself, I am criticizing marnen's obnoxious and
judgmental posts.  A post such as yours that takes the time to explain
to a poster why one approach is favored over another is welcome,
that's bad is simply an unsubstantiated opinion.  If he's not going
to provide assistance, he should either keep his mouth shut or be
ready to be chastised / derided in the same manner he treats others.

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Automatically create one child record when parent record is initially created

2010-08-29 Thread Bill Walton
Hi Chris,

On Sun, Aug 29, 2010 at 12:24 PM, Chris cdellin...@gmail.com wrote:
 Sorry for the newbie question in advance...  I've got three models, a
 user, site and user_site model.  A site can have many users and a user
 can have many sites.  The relationship between these two is stored in
 user_site. In my model defs user and sites both have has_many
 user_sites statement.  Within my user_sites file, there are two
 belongs_to statements, one for user and one for site.  within the What
 I'm looking to do is when a user is created initially to automatically
 create a record in user_site for a default site (I have it contained
 in an instance variable within the user controller).  What I'm not
 sure is how to most effectively do this so that the generated id for
 user is automatically pulled into the child record in user_site,
 basically I'm trying to come up with an efficient method for creating
 the user and user_site records.  Any guidance is much appreciated.

Use an after_create filter in your User model to create and populate
the record in user_sites with the user_id.

HTH,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Automatically create one child record when parent record is initially created

2010-08-29 Thread Bill Walton
On Sun, Aug 29, 2010 at 12:34 PM, Chris cdellin...@gmail.com wrote:
 How would I handle a failure in that second piece?  Can I put it in
 transaction and roll it back?

Probabl, though you'd have to throw an exception for a transaction to
be effective.  IIRC, Rails3 has support for creating associated
records built in but I haven't gotten around to working with 3 and you
didn't say what version you're using.

The easiest, most readable thing to do might be to just, in the controller...

if @user.save and @user.user_site
  

It's probably better, though, to move it into the User model's
after_create (untested code)

after_create :create_default_user_site_rec

def create_default_user_site_rec
  user_site_rec = UserSite.new
  user_site_rec.user_id = self.id
  unless user_site.save
 self.destroy
 false
  end
end

Tricky thing here is I'm not sure off the top of my head if the
failure of the after_create and its returning false will translate
into the save itself returning false.  Sorry I don't have the time to
run it to ground for you.  Hopefully this will give you some options
to investigate.

Best regards,
Bill

end

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



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

2010-08-28 Thread Bill Walton
Hi Pepe,

On Sat, Aug 28, 2010 at 7:16 AM, Pepe Sanchez li...@ruby-forum.com wrote:
 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?

I would suggest that you need to first identify your needs to decide
whether your new site is more web site, web application, or CMS.  Much
of that decision depends on the type of content (static vs.
dynamically driven by database content, how often static content
changes, and whether or not you want end-users top be able to make
most if not all changes to static content without developer
assistance.

Having made that choice, you 're then ready to begin comparing options
with respect to the tools you'll use to build that site.  Ruby on
Rails is the tool of choice for most readers of this list.  It is,
IMHO, the preeminent choice if you need a database-driven web
application.  It would be a very poor choice if what you really need
is just a static web site, and not much better if what you need is an
end-user-editable CMS.

At this point I think you're looking for someone who can help you
identify your needs.  I'm afraid I'm not aware of any mailing lists
that focus on that space.  So the first part of my recommendation
would be to reach out, preferably to someone you already know and
trust, for help in that.  If you don't have someone like that in your
'circle', then feel free to ask here.  There are many here who have
that experience in their background and this is a very helpful list.
A good starting point would be a link to the site you intend to
rebuild, along with some explanation of _why_ you're rebuilding it;
especially what it is that it doesn't do now that you really need it
to do?  You might want to start a new thread with a new subject;
something that includes 'need advice'.

Hope that helps,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



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

2010-08-28 Thread Bill Walton
Hi Pepe,

On Sat, Aug 28, 2010 at 3:28 PM, Pepe Sanchez li...@ruby-forum.com wrote:
 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 and I would like to paste
 it in the right place.

Craigslist is always a good place to post job offerings,   If you'd
like to find out what this list thinks re: whether or not your needs
are a good fit for a Rails deployment, feel free to post your scope
statement here with a subject like 'would this be a good candidate for
a RoR project?'

Best regards,
Bill

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Know of a Linux or Windows editor / IDE with support for TDD for RoR?

2010-08-25 Thread Bill Walton
I saw a demo of VisualStudio's support for TDD for C++ (or C#, I can't
recall which) this past weekend and was impressed.  Anybody know of an
editor or IDE for Linux (Ubuntu specifically) or Windows that has
built-in support for TDD for either Ruby or Rails?

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



  1   2   3   4   5   >