[Rails] Re: Error installing therubyracer

2013-11-01 Thread Lasse Bunk
Meck Z. wrote in post #1061376: Try this: $ gem uninstall libv8 $ gem install therubyracer It works for me. Worked for me too. -- 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

[Rails] ApiBuilder: XML and JSON builder in one

2011-09-19 Thread Lasse Bunk
://lassebunk.dk/2011/09/12/introducing-apibuilder-xml-and-json-builder-in-one/ ). /Lasse Bunk -- 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

Re: [Rails] Re: postgres set-up

2011-09-19 Thread Lasse Bunk
Use the 'pg' gem: gem 'pg' And in config/database.yml: development: adapter: postgresql database: my_checkins_development host: localhost Taken from a tutorial on my website: http://lassebunk.dk/2011/09/10/creating-a-location-aware-website-using-ruby-on-rails-and-postgis/

Re: [Rails] How to put Rails applications on the www.

2011-09-19 Thread Lasse Bunk
A preferred way of deploying Rails apps is using Capistrano ( https://github.com/capistrano/capistrano). It automates your deployment and also has a plugin (or recipe) (require bundler/capistrano) for installing gems via Bundler. /Lasse 2011/9/19 Martin Wawrusch mar...@wawrusch.com Don't even

[Rails] Re: How to update a Protected Attributes

2010-07-11 Thread Lasse Bunk
I have written a blog post on this subject: http://lassebunk.dk/2010/07/09/mass-assigning-protected-attributes-in-rails/ Hope this helps. Best regards, Lasse -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails:

Re: [Rails] attribute name selected in form

2010-06-23 Thread Lasse Bunk
Hi, I suppose the best way to do this would be to create a row for each word having a column for lang and a column for term. If you want to do it the way you describe, you could do it like this: With validation: @thesaurus.update_attributes params[:lang] = term Without validation:

Re: [Rails] attribute name selected in form

2010-06-23 Thread Lasse Bunk
Or you could make the [] method you mentioned. In your model: def []=(lang, term) self.attributes = { lang = term } end Then you can call it like you wanted: @thesaurus['fr'] = Bonjour /Lasse 2010/6/23 Lasse Bunk lasseb...@gmail.com Hi, I suppose the best way to do this would

Re: [Rails] Module accessing controller data

2010-04-15 Thread Lasse Bunk
Hi R. Vince, What does RuportController inherit from? /Lasse 2010/4/15 RVince rvinc...@hotmail.com I have data, :current_user, in my Application Controller: class ApplicationController ActionController::Base helper_method :current_user private def current_associate return

Re: [Rails] Problems with rake

2010-04-15 Thread Lasse Bunk
Could you try uninstalling rake and installing it again and see if that helps? Others have had success doing that :) /Lasse 2010/4/15 spud...@gmail.com spud...@gmail.com I receive an error when I try to create or setup database using rake command. Rake is installed. Error: bash:

Re: [Rails] Rails cascading delete

2010-04-02 Thread Lasse Bunk
Hi Hilal, You need to use :dependent = :destroy instead of :delete_all because :delete_all doesn't fire any callbacks. That's why it only deletes one level. /Lasse 2010/4/2 Hilal hilal.sha...@gmail.com Hello There: I am trying to do a deep cascading deletes in rails. The schema looks

Re: [Rails] rss feed

2010-04-02 Thread Lasse Bunk
Rahul, Try http://www.google.com/search?q=rails+rss+feed /Lasse 2010/4/2 Rahul Mehta rahul23134...@gmail.com hi all, for my project need to generate rss feed and place in folder what to do ? we need to have RSS feed generated and placed inside /feeds folder. Format of these feeds should

Re: [Rails] Re: rss feed

2010-04-02 Thread Lasse Bunk
http://paulsturgess.co.uk/articles/show/13-creating-an-rss-feed-in-ruby-on-rails 2010/4/2 Rahul Mehta rahul23134...@gmail.com its not giving useful result dear .. On Apr 2, 2:47 pm, Lasse Bunk lasseb...@gmail.com wrote: Rahul, Tryhttp://www.google.com/search?q=rails+rss+feed /Lasse

Re: [Rails] Re: rss feed

2010-04-02 Thread Lasse Bunk
.. On Apr 2, 3:25 pm, Lasse Bunk lasseb...@gmail.com wrote: http://paulsturgess.co.uk/articles/show/13-creating-an-rss-feed-in-ru... 2010/4/2 Rahul Mehta rahul23134...@gmail.com its not giving useful result dear .. On Apr 2, 2:47 pm, Lasse Bunk lasseb...@gmail.com wrote: Rahul

Re: [Rails] Newbie seeking advice on DRYing up my model validations...

2010-04-01 Thread Lasse Bunk
Hi Grar, If you have a User model where you want to use some shared validations, you could create a module like this – in lib/my_email_validations.rb: module MyEmailValidations def self.included(base) base.validates_presence_of :email base.validates_length_of :email, :minimum =

Re: [Rails] Re: Newbie seeking advice on DRYing up my model validations...

2010-04-01 Thread Lasse Bunk
. Finally, where attributes refer logically to the same kind of data, but have different names, I have aliased them to allow the broadest use of my version of your validation module. Thanks so much, Grar On Apr 1, 9:41 am, Lasse Bunk lasseb...@gmail.com wrote: Hi Grar, If you have a User

Re: [Rails] paper clip plugin error

2010-04-01 Thread Lasse Bunk
Try searching for the error on Google: http://www.google.dk/search?q=%22is+not+recognized+by+the+%27identify%27+command.%22 Hope this helps. /Lasse 2010/4/1 Rahul Mehta rahul23134...@gmail.com coming this error in my paper clilp plugin m getting this error * Photo

Re: [Rails] paper clip plugin error

2010-04-01 Thread Lasse Bunk
Especially try this one: http://blog.jonathanhinson.com/ (search for Getting Paperclip Working In Windows) /Lasse 2010/4/1 Lasse Bunk lasseb...@gmail.com Try searching for the error on Google: http://www.google.dk/search?q=%22is+not+recognized+by+the+%27identify%27+command.%22 Hope

Re: [Rails] Re: auto_complete: if no results returned, what gets submitted?

2010-03-30 Thread Lasse Bunk
Completed in 52ms (DB: 35) | 302 Found [http://localhost/expenses] In the first block, the name is still there (tester), but in the second, it isn't. Why would that be? Many thanks, Wim On Mar 26, 7:28 pm, Lasse Bunk lasseb...@gmail.com wrote: Wim, I just tried it out, and it works fine

Re: [Rails] Overriding default image, stylesheet and javascript paths...

2010-03-27 Thread Lasse Bunk
Colin Law clan...@googlemail.com On 26 March 2010 22:36, Lasse Bunk lasseb...@gmail.com wrote: It's hardcoded as you say. Being able to configure these paths would really be a good addition to the core if you were to write this as a new feature. /Lasse 2010/3/26 cult hero binarypala

Re: [Rails] displaying contnet

2010-03-27 Thread Lasse Bunk
Rajkumar, simple_format(text) – http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#M001751 /Lasse 2010/3/27 Rajkumar Surabhi li...@ruby-forum.com hi all, i am using text filed to store the database using textarea. i have entered the data line by line. while displaying

Re: [Rails] Re: Re: Re: Re: Prototype Helpers jQuery

2010-03-27 Thread Lasse Bunk
it? /Lasse 2010/3/27 Chris Kalaboukis li...@ruby-forum.com Chris Kalaboukis wrote: Chris Kalaboukis wrote: Lasse Bunk wrote: PS. Don't know if the loading of tooltip should be moved down below jQuery or Prototype – it depends on what it relies on. /Lasse 2010/3/26 Lasse Bunk lasseb

Re: [Rails] Timezone issue with legacy data stored in Eastern time

2010-03-27 Thread Lasse Bunk
Jonathan? 2010/3/27 Colin Law clan...@googlemail.com On 26 March 2010 21:43, Lasse Bunk lasseb...@gmail.com wrote: Jonathan, You could use Eastern Time (US Canada) as your timezone? Like this: config.time_zone = 'Eastern Time (US Canada)' Would this do the trick? No, because

Re: [Rails] caching fragement

2010-03-27 Thread Lasse Bunk
Raju, Check out http://api.rubyonrails.org/classes/ActionController/Caching.html http://api.rubyonrails.org/classes/ActionController/Caching/Pages.html http://api.rubyonrails.org/classes/ActionController/Caching/Fragments.html /Lasse 2010/3/27 Rajkumar Surabhi li...@ruby-forum.com HI all,

Re: [Rails] validating message

2010-03-27 Thread Lasse Bunk
Hi Rahul, The symbol (:content_masters) in error_messages_for should be the name of a variable, so if you wanted to display error messages for at variable called @user, you'd call it like this: %= error_messages_for 'user' % Please also see

Re: [Rails] HAS_MANY BELONGS_TO noobie question

2010-03-27 Thread Lasse Bunk
Hey David, It's really pretty easy and straightforward. In your PostsController: def create @post = current_user.posts.build(params[:post]) if @post.save # ... else # ... end end Also in your PostsController, to list posts only from current_user: def index

Re: [Rails] Re: Rake argument error

2010-03-27 Thread Lasse Bunk
I tried parsing the YAML as given by Raghu, and it worked after fixing the id:1 id: 1 error. /Lasse 2010/3/27 Colin Law clan...@googlemail.com On 27 March 2010 16:39, Raghu Maddali li...@ruby-forum.com wrote: Colin Law wrote: On 26 March 2010 20:39, Raghu Maddali li...@ruby-forum.com

Re: [Rails] Shorter Rails 3 routes

2010-03-27 Thread Lasse Bunk
Hi Paul, Take a look at shallow nesting: http://guides.rails.info/routing.html#shallow-nesting Hope this helps. /Lasse 2010/3/27 Paul A. li...@ruby-forum.com Hi, I have a small blog application, and I would like to shorten its routes. Here they are: Blog::Application.routes.draw do

Re: [Rails] Nested attributes with required protected attributes

2010-03-27 Thread Lasse Bunk
Hi Szimek, You can do it like this: # hash to simulate what comes from your params[:comment] comment = { :text = Comment text, :venues_attributes = [{ :name = one }, { :name = two }] } # you set the user id by calling a block on create Comment.create(model) { |c| c.venues.each { |v| v.user_id =

Re: [Rails] Nested attributes with required protected attributes

2010-03-27 Thread Lasse Bunk
Whoops, Comment.create(model) should of course be Comment.create(comment) And you should be able to replace it with Comment.create(params[:comment]) /Lasse 2010/3/27 Lasse Bunk lasseb...@gmail.com Hi Szimek, You can do it like this: # hash to simulate what comes from your params

Re: [Rails] Prototype Helpers jQuery

2010-03-26 Thread Lasse Bunk
Your noConflict solution is *almost* right. There is an error in that you call jquery (with lower case 'q') instead of jQuery (with upper case 'Q'). This is probably also the reason why the rest of your javascripts / Prototype helpers stop working. Try editing it like so: script

Re: [Rails] file upload error(can't convert Tempfile into String)

2010-03-26 Thread Lasse Bunk
Hey Tony, You just need name = upload['uploads'].original_filename instead of name = upload['uploads'] /Lasse 2010/3/26 Tony Augustine li...@ruby-forum.com i tried a method to implementa file uploader by using amethod below this is ma controlller method to upload def

Re: [Rails] Admin Sections Roles

2010-03-26 Thread Lasse Bunk
If you need some inspiration, you could take a look at the role_requirementhttp://github.com/timcharper/role_requirementplugin. It works with restful-authentication – I think it's great. /Lasse 2010/3/26 brianp brian.o.pea...@gmail.com Hey everyone. In the last app I made it was fairly

Re: [Rails] Converting TrueClass / FalseClass to integer.

2010-03-26 Thread Lasse Bunk
Hi Nick, That's a good question :-) I think a DRY way could be doing it like this: module BooleanToInteger def to_i self ? 1 : 0 end end [TrueClass, FalseClass].each { |c| c.send :include, BooleanToInteger } Hope this helps. /Lasse 2010/3/26 nick ger li...@ruby-forum.com

Re: [Rails] Re: How to include a ruby gem environment.rb file?

2010-03-26 Thread Lasse Bunk
Jorge, Nice – good you got it working :) /Lasse 2010/3/26 Jorge alejandro Mendoza torres li...@ruby-forum.com Hi Lasse. I had an application in version 2.0.2 and I changed the version of the application already had, I thought it would be harder, but it was very easy. On the page you

Re: [Rails] auto_complete: if no results returned, what gets submitted?

2010-03-26 Thread Lasse Bunk
Wim, I just tried it out, and it works fine for me – if I type a name that doesn't exist, then that name is submitted. In the controller: auto_complete_for :supplier, :name In the action: render :text = Name = #{params[:supplier][:name]} And in the view: %=

Re: [Rails] Active Record relations

2010-03-26 Thread Lasse Bunk
Hi Rajkumar, This is pretty basic Rails – it might be a good idea to study up on the Ruby on Rails guides http://guides.rubyonrails.org/ and the Agile Web Development with Railshttp://pragprog.com/titles/rails3/agile-web-development-with-rails-third-editionbook. I hope this is okay for you.

Re: [Rails] grouping and acts_as_tree

2010-03-26 Thread Lasse Bunk
Tom, Maybe it's just me but I don't quite understand... Could you explain what you're trying to achieve? /Lasse 2010/3/24 tom tomabr...@gmail.com hi, im using acts_as_tree and im not sure on how to group find-result. x = find.almost_all p % for y in @x.ancestors.reverse % %= link_to

Re: [Rails] Multilingual Email Within UserObserver?

2010-03-26 Thread Lasse Bunk
Hugues, Robby Russell has a pretty good blog posthttp://www.robbyonrails.com/articles/2009/11/16/sending-email-controllers-versus-modelsabout this subject – sending email from controllers vs. models. Please read the comments as well as there's a lot of helpful discussion going on there. I think

Re: [Rails] grouping and acts_as_tree

2010-03-26 Thread Lasse Bunk
child B999 child C245 CHILD D Root child D child B41 or even by length after grouping by title (CHILD A): Root child A Root child A child A1 Root child A child Axyz On Fri, Mar 26, 2010 at 1:37 PM, Lasse Bunk lasseb...@gmail.com wrote: Tom, Maybe it's just me but I don't

Re: [Rails] Re: Prototype Helpers jQuery

2010-03-26 Thread Lasse Bunk
Hmm, strange – do you get some sort of javascript error? /Lasse 2010/3/26 Chris Kalaboukis li...@ruby-forum.com Lasse Bunk wrote: Your noConflict solution is *almost* right. There is an error in that you call jquery (with lower case 'q') instead of jQuery (with upper case 'Q

Re: [Rails] Re: Re: Prototype Helpers jQuery

2010-03-26 Thread Lasse Bunk
Ok – just as a test, does it work if you delete these lines? jQuery.noConflict(); jQuery(document).ready( function() { jQuery(a[rel^='prettyPhoto']).prettyPhoto(); }); /Lasse 2010/3/26 Chris Kalaboukis li...@ruby-forum.com Lasse Bunk wrote: Hmm, strange – do you get some sort

Re: [Rails] Re: Re: Re: Prototype Helpers jQuery

2010-03-26 Thread Lasse Bunk
']).prettyPhoto(); }); /script Would this do the trick? /Lasse 2010/3/26 Chris Kalaboukis li...@ruby-forum.com Lasse Bunk wrote: Ok – just as a test, does it work if you delete these lines? jQuery.noConflict(); jQuery(document).ready( function() { jQuery(a[rel^='prettyPhoto

Re: [Rails] Re: Re: Re: Prototype Helpers jQuery

2010-03-26 Thread Lasse Bunk
PS. Don't know if the loading of tooltip should be moved down below jQuery or Prototype – it depends on what it relies on. /Lasse 2010/3/26 Lasse Bunk lasseb...@gmail.com Ok, what I didn't think of was that the jQuery noConflict call should of course occur *before* loading Prototype, like

Re: [Rails] Rake argument error

2010-03-26 Thread Lasse Bunk
Hey, The error is that there's no space in id:1 in the YAML. /Lasse 2010/3/26 Colin Law clan...@googlemail.com On 26 March 2010 20:39, Raghu Maddali li...@ruby-forum.com wrote: Hi, I'm having a problem loading a sample data with simple rake command. rake db:fixtures:load When I

Re: [Rails] Timezone issue with legacy data stored in Eastern time

2010-03-26 Thread Lasse Bunk
Jonathan, You could use Eastern Time (US Canada) as your timezone? Like this: config.time_zone = 'Eastern Time (US Canada)' Would this do the trick? /Lasse 2010/3/26 J Graham jkgra...@gmail.com Hello, I've Googled and searched for this for many hours now and couldn't find an answer

Re: [Rails] Overriding default image, stylesheet and javascript paths...

2010-03-26 Thread Lasse Bunk
It's hardcoded as you say. Being able to configure these paths would really be a good addition to the core if you were to write this as a new feature. /Lasse 2010/3/26 cult hero binarypala...@gmail.com Is there some way to override the paths for images, stylesheets and javascripts without

Re: [Rails] Re: Re: redirection in format.json ...

2010-03-25 Thread Lasse Bunk
Again: Make sure that format.json is in fact called. Maybe try removing format.html to make sure that the redirect isn't done there. /Lasse 2010/3/25 Kad Kerforn li...@ruby-forum.com Lasse Bunk wrote: Maybe you're not requesting it properly, making sure that you call the format.json part

Re: [Rails] Re: More elegant solution for missing has-many through ids?

2010-03-25 Thread Lasse Bunk
He he he NICE :-) /Lasse 2010/3/25 Dudebot craign...@gmail.com On Mar 24, 4:42 pm, Lasse Bunk lasseb...@gmail.com wrote: This should do it: LabDesc.find(:all, :conditions = 'NOT EXISTS(SELECT * FROM lab_desc_groups WHERE lab_desc_id=lab_descs.id)') Lasse, you have my SQL Guru

Re: [Rails] Re: How to open Pdf or doc file in firefox

2010-03-25 Thread Lasse Bunk
Colin is right. After googling it ( http://www.google.com/search?q=firefox+view+pdf+in+browser) found the following page: http://support.mozilla.com/en-US/kb/opening+PDF+files+within+Firefox . /Lasse 2010/3/25 Colin Law clan...@googlemail.com On 25 March 2010 15:32, Hemant Bhargava

Re: [Rails] flash error fade away

2010-03-25 Thread Lasse Bunk
Hey, Not quite understood – could you explain further? Thanks, /Lasse 2010/3/24 tom tomabr...@gmail.com this is my current code: #notice { border: solid 1px #99cc99; background-color: #e2f9e3; color: #006600; padding: 5px; margin-bottom: 5px; } #notice.error { border-color:

Re: [Rails] flash error fade away

2010-03-25 Thread Lasse Bunk
being saved There were problems with the following fields: - Title can't be blank to fade away. so not sure how to do that... thx On Thu, Mar 25, 2010 at 2:25 PM, Lasse Bunk lasseb...@gmail.com wrote: Hey, Not quite understood – could you explain further? Thanks, /Lasse

Re: [Rails] How to include a ruby gem environment.rb file?

2010-03-25 Thread Lasse Bunk
Hi Jorge, It's because config.gem was first introduced in version 2.1 – that's why it doesn't work in 2.0.2. You can see that in http://api.rubyonrails.org/files/vendor/rails/railties/CHANGELOG.html by looking under Added config.gem for specifying which gems are required by the application and

Re: [Rails] dispatch.cgi, dispatch.fcgi, dispatch.rb not present in Public folder

2010-03-24 Thread Lasse Bunk
Check out http://www.anchor.com.au/hosting/dedicated/Running-Rails-2.3-Using-CGI-with-Rackunder The Meat. /Lasse 2010/3/24 Peter peterorp...@me.com I'm doing a series of ruby on rails tutorials and it got to a part where i need to edit the following files that should be automatically inside

Re: [Rails] dispatch.cgi, dispatch.fcgi, dispatch.rb not present in Public folder

2010-03-24 Thread Lasse Bunk
Or you could use mod_rails http://www.modrails.com/ (Passenger) instead. /Lasse 2010/3/24 Lasse Bunk lasseb...@gmail.com Check out http://www.anchor.com.au/hosting/dedicated/Running-Rails-2.3-Using-CGI-with-Rackunder The Meat. /Lasse 2010/3/24 Peter peterorp...@me.com I'm doing

Re: [Rails] attr_accessor in AR models?

2010-03-24 Thread Lasse Bunk
You _can_ use attr_accessor in ActiveRecord models. Like this: class Article ActiveRecord::Base attr_accessor :my_prop end Maybe you could post some code and/or error message. /Lasse 2010/3/24 elliottg x...@simplecircle.net Am I correct in thinking that one cannot use attr_accessor

Re: [Rails] Re: redirection in format.json ...

2010-03-24 Thread Lasse Bunk
Maybe you're not requesting it properly, making sure that you call the format.json part? It seems it redirects to requests_url in format.html. /Lasse 2010/3/23 Kad Kerforn li...@ruby-forum.com in my controller the create action is : respond_to do |format| if @request.save

Re: [Rails] Re: redirection in format.json ...

2010-03-24 Thread Lasse Bunk
Just to clarify: A proper json request is to call /path.json or call /path (with or without .json) with an Accept: application/json header. /Lasse 2010/3/24 Lasse Bunk lasseb...@gmail.com Maybe you're not requesting it properly, making sure that you call the format.json part? It seems

Re: [Rails] dispatch.cgi, dispatch.fcgi, dispatch.rb not present in Public folder

2010-03-24 Thread Lasse Bunk
Glad you found out :) /Lasse 2010/3/24 Peter Simmons peterorp...@me.com thank you, so they aren't meant to be there nowadays, I originally thought i had done something wrong, i can move on now, cheers On 24 Mar 2010, at 20:25, Lasse Bunk wrote: Or you could use mod_rails http

Re: [Rails] Re: attr_accessor in AR models?

2010-03-24 Thread Lasse Bunk
missing here? Thanks, Elliott G On Mar 24, 4:28 pm, Lasse Bunk lasseb...@gmail.com wrote: You _can_ use attr_accessor in ActiveRecord models. Like this: class Article ActiveRecord::Base attr_accessor :my_prop end Maybe you could post some code and/or error message

Re: [Rails] More elegant solution for missing has-many through ids?

2010-03-24 Thread Lasse Bunk
This should do it: LabDesc.find(:all, :conditions = 'NOT EXISTS(SELECT * FROM lab_desc_groups WHERE lab_desc_id=lab_descs.id)') /Lasse 2010/3/24 Dudebot craign...@gmail.com I have LabGroup and LabDesc which have many through LabDescGroup. I'd like to identify LabDescs which don't have a

Re: [Rails] :has_many and :controller specified in routes.rb

2010-03-23 Thread Lasse Bunk
Maybe you could use: map.resources :buckets, :controller = 'v1/buckets' do |buckets| buckets.resources :apples, :controller = 'v1/apples' end I know this is a bit more code than just using :has_many, but I don't think :has_many lets you specify a different controller. /Lasse 2010/3/23 gsw

Re: [Rails] redirection in format.json ...

2010-03-23 Thread Lasse Bunk
Here is an example: format.json { render :json = { :redirect = requests_url } } and then on your client redirect like this: if (json.redirect) { window.location = json.redirect; } Also try http://www.google.com/search?q=json+redirect Does this solve your problem? /Lasse 2010/3/23

Re: [Rails] photo gallery for each User

2010-02-22 Thread Lasse Bunk
Or just http://github.com/thoughtbot/paperclip Here's some inspiration for using paperclip to create a photo gallery (it has many galleries/albums per user though): http://www.joesak.com/2009/09/18/online-photo-gallery-payment-order-fulfillment-ruby-on-rails-tutorial/ Lasse 2010/2/21 Ease Bus

Re: [Rails] HELP ON HTML CONTENT MODIFICATION

2010-02-15 Thread Lasse Bunk
Here's a hpricot example that works: require 'rubygems' require 'hpricot' doc = Hpricot(htmlbodypimg src=\/2010-01-12/Capture/1210420100112145725141.jpg\ //p/body/html) doc.search('img').each do |img| img['src'] = img['src'].gsub(/^\/\d{4}-\d{2}-\d{2}/, ) # have to do gsub – gsub! doesn't

Re: [Rails] Active record validation Issue

2010-02-15 Thread Lasse Bunk
Are you using the acts_as_taggable plugin? 'Cause then tag_list varies between string and array. Don't know if that's the case here though. --Lasse 2010/2/15 Web Developer li...@ruby-forum.com Hello, I am trying to put some validation using active records onto form fields. like this -

Re: [Rails] Re: state select box to be populated according to country

2010-02-15 Thread Lasse Bunk
You need to but dynamic_states.js in your public/javascripts folder. --Lasse 2010/2/15 Tom Mac li...@ruby-forum.com Hi Ryan Bates got a railscasts episode that deals with this exact case: http://railscasts.com/episodes/88-dynamic-select-menus Thanks for your reply. I have tried this

Re: [Rails] Re: getting a 500 internal server error with apache

2010-02-15 Thread Lasse Bunk
A quick Google turned up this: http://serendipity.ruwenzori.net/index.php/2006/12/24/proxy-no-protocol-handler-was-valid-for-the-url Sounds like it's something with mod_proxy... --Lasse 2010/2/15 Gautam gautamrock...@gmail.com Here are my error logs... i don't understand what's going

Re: [Rails] Re: Problem with internationalization

2010-02-15 Thread Lasse Bunk
I tried to read through the thread but didn't actually find an answer... Isn't the solution to make sure that en.yml is UTF-8 encoded, ie it in UTF-8? --Lasse 2010/2/15 Marnen Laibow-Koser li...@ruby-forum.com Ralph Shnelvar wrote: Yes, that seems to be Latin-1. Why are you using Latin-1

Re: [Rails] will_paginate question

2010-02-15 Thread Lasse Bunk
Rewriting your example a little, I think I would do it like this: # controller @person = Person.find(params[:id]) @person_previous = Person.first, :order = 'id DESC', :conditions = [id ?, @person.id] @person_next = Person.first, :order = 'id ASC', :conditions = [id ?, @ person.id] # view %=

Re: [Rails] Re: will_paginate question

2010-02-15 Thread Lasse Bunk
As I understand it, what he wants to do is not really pagination. Pagination is users?page=1 but what he wants is to be at user/10 and when he clicks next, it goes to user/11, when previous, user/9. --Lasse 2010/2/15 EvanC e...@cancelliere.ca Hi Bigos, You aren't using the view helper

Re: [Rails] Re: will_paginate question

2010-02-15 Thread Lasse Bunk
Oops, of course the url's should be users/10, users/9 and users/11 :) --Lasse 2010/2/15 Lasse Bunk lasseb...@gmail.com As I understand it, what he wants to do is not really pagination. Pagination is users?page=1 but what he wants is to be at user/10 and when he clicks next, it goes to user

Re: [Rails] [JOBS] Remote assistance requested for RoR setup.

2010-02-14 Thread Lasse Bunk
Why not use Robby Russells walkthrough: http://www.robbyonrails.com/articles/2010/02/08/installing-ruby-on-rails-passenger-postgresql-mysql-oh-my-zsh-on-snow-leopard-fourth-edition? He does a great job, and when you're done, you have all you need. :-) Lasse 2010/2/13 john h johnhoec...@gmail.com

Re: [Rails] Bundler ignores :group = :production?

2010-02-14 Thread Lasse Bunk
At my dev box it doesn't listen to the group parameter either. Just to let you know that it isn't just your box – maybe something in Rails 3? 2010/2/13 Steve Rowley srow...@gmail.com I'm using SQLite on my dev box and MySQL in production. I'm also running an old mysql adapter gem in production

Re: [Rails] Is ActioveResource suitable for use eBay/PayPal api's?

2010-02-14 Thread Lasse Bunk
From this page: http://www.therailsway.com/2007/9/3/using-activeresource-to-consume-web-services 1. The service must understand Rails-style REST URLs. (e.g. “POST /credit_cards.xml” to create a credit card, etc.) 2. The service must respond with a single XML-serialized object

Re: [Rails] sharing a method, model, module or ???

2010-02-14 Thread Lasse Bunk
It depends on what you want the method to do. Inside the Picture class, this should work: class Picture ActiveRecord::Base # ... def self.get_most_viewed_picture pic = Picture.find(:first, :conditions = [active = ?, true], :order = 'view_count DESC') pic.increment! :view_count

Re: [Rails] forcing lower case in form helper label

2010-02-14 Thread Lasse Bunk
f.label :something, something :-) Lasse 2010/2/14 Ralph Shnelvar li...@ruby-forum.com f.label 'something' produces Something instead of something How can I force f.label to have a lower case initial letter? -- Posted via http://www.ruby-forum.com/. -- You received this message

Re: [Rails] Re: forcing lower case in form helper label

2010-02-14 Thread Lasse Bunk
://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#M001606 :-) Lasse 2010/2/14 Ralph Shnelvar li...@ruby-forum.com Lasse Bunk wrote: f.label :something, something :-) Lasse 2010/2/14 Ralph Shnelvar li...@ruby-forum.com Well ... that certainly was simple but then what

Re: [Rails] Re: forcing lower case in form helper label

2010-02-14 Thread Lasse Bunk
Super – glad you found out :-) Lasse 2010/2/14 Ralph Shnelvar li...@ruby-forum.com Ralph Shnelvar wrote: Lasse Bunk wrote: f.label :something, something :-) Lasse 2010/2/14 Ralph Shnelvar li...@ruby-forum.com Well ... that certainly was simple but then what is the purpose

Re: [Rails] Can't mass-assign these protected attributes: tag_attributes

2010-02-14 Thread Lasse Bunk
I think you need to add :tag_attributes to attr_accessible in your model – would this fix the problem? Lasse 2010/2/14 Greg Ma li...@ruby-forum.com Hi, I added a textarea to my edit student form, to be able to add tags to this student. I did the simple code below, and this is the error i

Re: [Rails] how to describe negative find condition in has_many

2010-02-14 Thread Lasse Bunk
Try: named_scope :without_active_players, :conditions = NOT EXISTS(SELECT * FROM players WHERE team_id=teams.id AND status='active'), :order = name Does this work? Lasse 2010/2/14 cpr crosebr...@gmail.com I have a Teams that has_many Players. I need to get the list of Teams that have no