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
://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
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/
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
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:
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:
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
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
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:
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
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
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
..
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
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 =
.
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
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
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
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
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
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
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
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
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,
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
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
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
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
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 =
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
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
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
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
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
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
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:
%=
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.
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
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
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
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
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
']).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
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
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
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
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
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
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
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
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:
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 -
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
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
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
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
%=
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
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
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
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
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
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
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
://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
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
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
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
80 matches
Mail list logo