Job Description
Casetabs is looking for a talented, enthusiastic Ruby on Rails developer
who can hit the ground running and is eager to learn and grow into a
leadership role. You'll join an existing team, but will have the
opportunity to gradually take ownership of application development
Are you a skilled Ruby on Rails Developer? Then our client would love to
hear from you.
My client is a global Pre-IPO company with four offices worldwide and is
still growing rapidly.
This is your chance to work in a fast paced, exciting environment and to
get exposure to cutting edge technology
I have a rails app which supports multiple domains and each domain may
have multiple subdomains.
Users visiting mydomain1.com do not receive the same experience as
mydomain2.com (although the base behaviour of the apps is the same)
Therefore, if a user is logged in to mydomain1.com, it shouldn't
I'm working on a Rails application at the moment which seems to kill
the memory on my iMac until I eventually have to restart.
I have a 2.66 GHZ processor with 4GB Ram on OSX 10.6.
When I boot the rails app, the memory consumption shows the following
(ps aux | grep rails):
Gavin 726 0.0
, Gavin Morrice ga...@gavinmorrice.comwrote:
I'm working on a Rails application at the moment which seems to kill
the memory on my iMac until I eventually have to restart.
I have a 2.66 GHZ processor with 4GB Ram on OSX 10.6.
When I boot the rails app, the memory consumption shows
Hey Kev!
You ever find the solution to this issue?
Im running three rails apps on my server, all on the same version of
rails.
One of them runs fine, the other two kick up this error when I try to
start them.
Any clues would be helpful?
Thanks
Gav
kev...@googlemail.com wrote:
I cannot
I've tried everything I can think of, but bundle install is still
installing all new gems into /User/.gems. My GEM_HOME is /usr/local/
lib/ruby/gems/. Is this a bug?
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post to this group,
Yes
On Feb 8, 12:59 pm, Erol Fornoles erol.forno...@gmail.com wrote:
On Feb 8, 12:29 pm, Gavin gav...@gmail.com wrote:
I've tried everything I can think of, but bundle install is still
installing all new gems into /User/.gems. My GEM_HOME is /usr/local/
lib/ruby/gems/. Is this a bug
Hey all
I'm experimenting with writing a scraper at the moment and have hit a
major hump.
Part of the DOM is added after the page has loaded via javascript.
This means when I make an a request the HTML response I receive back
doesn't accurately represent the page.
Here's a simplified example:
doesn't send, it's likely an issue with your login details
or with the smtp domain.
Also, check that
config.action_mailer.raise_delivery_errors = true
in production.rb - the error messages could give helpful clues.
Hope that helps
Gavin
Adam Meyer wrote:
Hey everyone
I put my developed app
Greg -
Check out
http://api.rubyonrails.org/classes/ActionController/Streaming.html#M000421
On Sep 20, 10:07 pm, Greg Hauptmann greg.hauptmann.r...@gmail.com
wrote:
Hi,
Q1 - What's the current most popular approach (plugin/gem or
otherwise) for sending files / streaming files (e.g. images)
Bingo Bob,
Just tried this out on my own machine.
Works fine for me.
What version of ActiveRecord are you using?
On Sep 19, 7:31 am, bingo bob rails-mailing-l...@andreas-s.net
wrote:
I do this in my model.
named_scope :popular, :order = 'name', :conditions =
['popular_resort = ?', true]
that helps?
Gavin
http://handyrailstips.com
On Sep 19, 7:31 am, bingo bob rails-mailing-l...@andreas-s.net
wrote:
I do this in my model.
named_scope :popular, :order = 'name', :conditions =
['popular_resort = ?', true]
default_scope :order = 'resort_height DESC, name'
By default my
Bob,
I'm running Rails 2.3.4 now - so ActiveRecord 2.3.4
This definitely works fine on my machine so I'd guess it was a bug in
ActiveRecord 2.3.2.
would you consider updating your application to rails 2.3.4?
Gavin
On Sep 19, 2:40 pm, bingo bob rails-mailing-l...@andreas-s.net
wrote:
in case
do it.
Let me know if that solves the issue?
Gavin
On Sep 19, 3:07 pm, bingo bob rails-mailing-l...@andreas-s.net
wrote:
Gavin Morrice wrote:
Bob,
I'm running Rails 2.3.4 now - so ActiveRecord 2.3.4
This definitely works fine on my machine so I'd guess it was a bug in
ActiveRecord
you have the option to install gems on the server?
Gavin
http://handyrailstips.com
On Sep 17, 2:42 pm, Snaggy l.cio...@gmail.com wrote:
or in general how to put gems there? I have a patch to apply to rack/
methodoverride.rb but I can't find it...
how can I copy rack in vendor and not modify
That makes sense!
Thanks for that!
On Sep 11, 7:33 pm, pharrington xenogene...@gmail.com wrote:
On Sep 11, 12:12 pm, Gavin ga...@thinkersplayground.com wrote:
When writing Ruby you have the option to end the file early with
__END__. Anything after the __END__ is assigned to a constant
= { :price = $150, :battery_life = 8
hours, ... etc... }
Maybe this 'virtual class' approach isn't best for your app but
perhaps there are other, similar approaches?
Gavin
On Sep 11, 11:34 am, RVince rvinc...@hotmail.com wrote:
I am looking for a sort of scaffolding (because the schema
attributes would likely screw up ActiveRecord though, that was silly
of me. Perhaps another name like virtual_attributes would be better.
On Sep 11, 5:22 pm, Gavin ga...@thinkersplayground.com wrote:
Hey RVince
Creating tables at runtime sounds really messy - have you considered
other
And I have to say, Phlip, I really think that you are God's Gift to
Testing...
Phil, do you have a blog?
Gavin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post to this group, send
Thanks for the suggestions guys
I opted for completely removing my old build and all of the gems in
favor of the new one (as it was in opt/local as opposed to usr/local)
It's been a messy learning experience but all is working fine now,.
:S
On Aug 2, 5:15 pm, Marnen Laibow-Koser
to Ubuntu (your Home and End keys will start working, too!)
Marnen Laibow-Koser wrote:
Huh? Home and End work fine on Mac OS X. So do Ctrl-A and Ctrl-E.
Gavin wrote:
I opted for completely removing my old build and all of the gems in favor
of the new one (as it was in opt/local as opposed to usr
Hey all
I installed FXRuby today using macports and i believe it's installed
another copy of Ruby in /opt/local/bin/ruby
ls -l `which ruby` # = -rwxr-xr-x 2 root admin 13412 Aug 1
16:50 /opt/local/bin/ruby
cat 'which gem` | head -n 1 # = #!/usr/local/bin/ruby
This means that when I try to
map.resource :search, :controller = search_controller
map.suche suche, :controller = search_controller, :action =
new
Is that what you're looking for?
Gavin
http://handyrailstips.com
On Jul 30, 2:23 pm, John Smith rails-mailing-l...@andreas-s.net
wrote:
I have some controllers with member
think you may have to explicitly state the relative path in your
links though,
like:
%= link_to suchen, /suchen %
and
%= link_to search, /search %
or if you're using locales:
%= link_to t('search.name'), /#{t 'search.name'} %
hope that helps?
Gavin
http://handyrailstips.com
On Jul 30, 2:53
Hey
could you post the full error message?
Before you do, try rake db:schema:dump
If you're schema.rb is exactly how you want the db to be setup then
it's a quicker option than building a bunch of separate migrations
Gavin
http://handyrailstips.com
On Jul 29, 3:09 pm, RVince rvinc
the controller that
deals with creating and maintaining its records you could try:
def get_model
self.class.to_s.gsub(Controller,).singularize.constantize
end
This would return Comment if called in the CommentsController.
Hope that helps?
Gavin
http://handyrailstips.com
On Jul 20, 6:35 am, Thriving
Model.destroy(array)
end
This will raise an error if the ids are not all valid and you'll know
to look elsewhere for the root of the problem
Hope that helps?
Gavin
http://handyrailstips.com
On Jul 20, 8:59 am, Sandip Ransing san2...@gmail.com wrote:
Hello friends !
Model.destroy(array
Hey
Could you paste the full trace and error?
I doubt this is an error with your gem versions.
Gavin
http://handyrailstips.com
On Jul 20, 6:56 am, jko170 jko...@gmail.com wrote:
When I run rake test:units I get this error:
292 tests, 350 assertions, 2 failures, 13 errors
rake aborted
doc:plugins
http://handyrailstips.com/tips/11-some-handy-rake-tasks
http://handyrailstips.com/tips/12-documenting-your-application-or-plugin-using-rdoc
Hope that helps?
Gavin
On Jul 18, 7:09 pm, ezulo...@gmail.com ezulo...@gmail.com wrote:
I havent been able to find any downloadable
be_a_new_record you're essentially saying that the new_record? method
should be called and should return true.
If you're getting a NoMethod error specifically on be_a_new_record
then you might want to ensure you have the latest versions of rspec
and rspec-rails.
Hope that helps?
Gavin
http
Hey,
Why not try:
def destroy
id = params[:id]
render :update do |page|
page.alert( THIS TEXT ) if Job.find(:all, :conditions=
[type_id=?,id]).size 0
end
end
Gavin
http://handyrailstips.com
On Jul 14, 7:21 pm, Mickael Faivre-Macon rails-mailing-l...@andreas-
s.net wrote:
Hi
forgot to add the .destroy() call there :S
On Jul 14, 7:40 pm, Gavin ga...@thinkersplayground.com wrote:
Hey,
Why not try:
def destroy
id = params[:id]
render :update do |page|
page.alert( THIS TEXT ) if Job.find(:all, :conditions=
[type_id=?,id]).size 0
end
end
Gavin
Xiahong,
The message Test is not a module is the error you want to address.
I'd check that your test helper doesn't have include Test or maybe
Test.module_eval someplace in it.
:S
On Jul 13, 3:15 pm, Xiahong Gao gaox...@gmail.com wrote:
Hi everyone,
I ran into some problems during
Rookie
Love the name
:)
--~--~-~--~~~---~--~~
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
:
map.resources :items, :collection = { :lost = :get, :found
= :get, :broken = :get }
def lost
@items = Item.lost
end
...and so on.
Again, quite clear routes and descriptive urls but I'm under the
impression that this is a less RESTful approach.
Any thoughts?
Thanks
Gavin
thanks Rob,
I also think this is the most simple approach but was really keen to
get a 2nd opinion.
Gavin
On Jul 10, 7:59 pm, Rob Biedenharn r...@agileconsultingllc.com
wrote:
On Jul 10, 2009, at 12:55 PM, Gavin wrote:
Hi all
I'm working on an app at the moment and I'm trying
aware that you can include associations in find queries with
:include
http://api.rubyonrails.org/classes/ActiveRecord/Base.html
Off the top of my head, try:
Category.all :include = :articles, :order = articles.published_on
DESC
Let me know if that works
Cheers,
Gavin
http://handyrailstips.com
to achieve?
Gavin
http://handyrailstips.com
--
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
Sweet - wasn't aware of that one
Thanks
:)
Gavin
http://handyrailstips.com
--
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
suppose in the action you'd just call something like
def my_action
render :partial = params[:partial_name]
end
not 100% sure if that would work the way you want it to though.
Can you elaborate a little more?
Gavin
http://handyrailstips.com
--
Posted via http://www.ruby-forum.com
Now that I think about it - don't think this would work
render looks through the view folders for your partial - not sure if
you'd be able to store them in the public directory
:S
Gavi
http://handyrailstips.com
--
Posted via http://www.ruby-forum.com/.
with more than one format (eg. html and
js) then you should use the respond_to method.
Otherwise,
def my_ajax_action
@content = # new content for your table
replace id_of_table, render(:partial = partial_name, :locals
= {:content = @content } )
end
Hope that helps?
Gavin
http
that require it. I've also
tried various combinations with 'eval' and 'send' etc.
The validations aren't called :(
Can anyone explain why this isn't working and if it's possbile to re-
use validations like this?
Thanks
Gavin
--~--~-~--~~~---~--~~
You received this message
Ha!
Rookie error
Thanks for that Fred.
:)
On Jul 5, 4:52 pm, Frederick Cheung frederick.che...@gmail.com
wrote:
On Jul 5, 11:42 am, Gavin ga...@thinkersplayground.com wrote:
module CommonValidations
def included(base)
base.class_eval do
validates_presence_of :name
Hi - Why not develop the plugin in your app's /lib directory first?
Once you're happy with how it works, you can transfer it over to the
plugin's /lib directory
That way you don't have to restart the server or change your apps
configuration options
Gavin
http://handyrailstips.com/
On Jul 3
To get rid of the user is invalid, remove
validates_associated :user from the UserInfo model
Meanwhile, read up on validates_associated:
http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#M002461
and make sure you want ot use it here.
Gavin
http://handyrailstips.com
To get rid of the user is invalid, remove
validates_associated :user from the UserInfo model
Meanwhile, read up on validates_associated:
http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#M002461
and make sure you want ot use it here.
Gavin
http://handyrailstips.com
Hey all!
Im building an app at the moment in which users can upload images of
themselves.
The problem is, because these images are stored in the public
directory they are open to the public.
How can I protect these images but still allow access to them in my
views?
thanks
Gavin
and checking out
pictures they don't have access to.
So far, encypting the image name seems to be the only solution.
ie- images/8dfa7dg6g82h9dhn9njn23knjkknsdf9.jpg
Making it a little more difficult to 'guess' the picture url.
Anybody know of a better way to handle this?
Gavin
On Jul 3, 1:45 pm
be blank you'll need to
access it either through %= error_messages_for :user % or
@user.errors.on(:first_name)
Hope that helps
Gavin
http://handyrailstips.com
On Jul 3, 3:15 pm, Salil Gaikwad rails-mailing-l...@andreas-s.net
wrote:
Hi All,
I want to enter parameters in 2 tables which
Gavin
--~--~-~--~~~---~--~~
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
Alrighty...
Was not aware of that.
I think in this case it's best to go with the encrpted filename
option because I'll might have loads of images to render per page.
Thanks for your help guys.
Gavin
On Jul 3, 3:40 pm, Nicholas Henry nicholas.he...@gmail.com wrote:
You can send a file inline
option because I'll might have loads of images to render per page.
^ apologies for the crap grammar - writing in a hurry today
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post to
Thanks Nicholas,
I have used send_file before, but I had no idea that the 'inline'
option was available.
You've also helped answer the problem I've had with my mp3_player
plugin (http://handyrailstips.com/tips/7-playing-mp3-s-on-your-rails-
site-with-mp3_player)
Thanks again :)
Gavin
What version of Rails are you using?
On Jul 2, 1:56 pm, Peter Hermansson rails-mailing-l...@andreas-s.net
wrote:
Hi, I am trying to follow the book 'Beginning Ruby on Rails e-commerce'
examples.
When I come to unit testing I get an error message:
C:/Ruby/bin/ruby.exe -Ilib;test
yep
assuming the timestamp is returning a DateTime object, just call the
hour method on that
eg.
@user.created_at.hour would return an integer that is between 0 and 23
so
@user.created_at.hour 0 and @user.created_at.hour 4
Gavin
http://handyrailstips.com
/toggle
Gavin
http://handyrailstips.com
On Jun 26, 4:52 am, Bharat Ruparel rails-mailing-l...@andreas-s.net
wrote:
The Rails Guides are at the following address:
http://guides.rails.info/
They look really good. I am particularly interested in learning how to
create the nice looking pop-up menu
Check out http://railscasts.com/episodes/71-testing-controllers-with-rspec
Gavin
http://handyrailstips.com
On Jun 26, 2:33 am, robokos zol...@gmail.com wrote:
Hi
I am very new to rspec and would like to learn more. I have googled
around and asked in irc with no firm answers.
I have
http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#M001983
see the options list, :default
Gavin
http://handyrailstips.com
On Jun 25, 8:26 pm, dansinker dansin...@gmail.com wrote:
I've got a simple form that uses date_select and I'd love to have it
automatically choose
you have a good
reason not to, I'd recommend calling your controller method create
and letting Rails behave the way it wants to.
which 'line feed' do you want to remove?
Gavin
http://handyrailstips.com
On Jun 24, 4:46 pm, JannaB mistressja...@hotmail.com wrote:
I have a model (Ups
Sorry, to answer the original question:
My question is, within my UpsController.newchannel(), how do I access
the calue of the channel_id that has been selected in the form
submission?
When rails posts a form to an action, all of the info from the form
will be included in a hash called
:
%= f.collection_select :channel_id, @channels, :id, :prompt = true
%
Hope that helps?
Gavin
http://handyrailstips.com
On Jun 24, 5:58 pm, JannaB mistressja...@hotmail.com wrote:
Gavin,
Thank you. But suppose I didn't use a named scope -- in that case, how
then could I refer to it in my controller
damn - sorry that should be:
%= f.collection_select :channel_id, @channels, :id, :channel, :prompt
= true %
missed out the text_method param
Gavin
http://handyrailsitps.com
On Jun 24, 6:40 pm, Gavin ga...@thinkersplayground.com wrote:
Try using %- end -% instead of % end
Okay - I'm assuming the action your form posts to is newchannel and
you want to access the input from the form in that method?
In which case:
@channel_id_you_want = params[:ups][:channel_id]
That should work?
Gavin
http://handyrailstips.com
On Jun 24, 6:59 pm, JannaB mistressja
-20linkCode=as2camp=1789creative=390957creativeASIN=0321445619
Gavin
On Jun 20, 3:04 am, rubyrailer23 rubyraile...@gmail.com wrote:
Can someone help me get started with ruby on rails? I searched a lot
of tutorials on how to get it started but most are out dated and all
doesn't seems to work
messages_users.
Gavin
On Jun 21, 7:05 am, Alexander Trauzzi rails-mailing-l...@andreas-
s.net wrote:
Hello all!
I'm looking to get some help answering a design problem I'm facing. I'm
definitely familiar with how models house all the business logic, but
when it RoR, I'm somewhat confused
Sorry -
That should have been, Message.public, not messages.public.
named_scope adds a class method
On Jun 21, 9:55 am, Gavin ga...@thinkersplayground.com wrote:
Hi,
why not add a named scope to messages:
named_scope :public, :conditions = {:public = true}
So you can call either
be:
Deal.find(:all, :conditions = [item_title LIKE ?,
%#{params[:search]}%])
Also - why have you set the value for the text_field_tag to
params[:search]?
Gavin
http://handyrailstips.com
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received
You're welcome :)
I see what you've done with the params[:search]
This is used to show the search term in the text-box on the results
page.
This seems perfectly reasonable
Gavin
http://handyrailstips.com
Aaron Day wrote:
I alright I think my problem was that I was using to sources
Hi Valentino
You shouldn't use puts, for output in the view.
You probably want to split the info for each event into seperate cells
so your table is well-structured.
In which case I'd write a helper_method and throw most of the work
into there.
If not, you can stop html from collapsing
Newb Newb wrote:
Hi..
i have a auto complete field for my authority_id field.authority_id
field is not mandatory.if the user not fills it will take the default
authority id as value.
but i want to validate if the user enters invalid authority name into
the auto complete text box...
i can
Sure,
From what you've written, it looks like your event model has
attributes called dreq_reqno, dreq_status and dreq_create_time and
you've joined these together with the event_detail method.
If this is the case, you could add a method in on of your helper files
(probably EventsHelper) that
:
Page.find_by_pageTitle(:pageTitle)
Also - I would try to stick to the convention of underscoring column
names rather than camelCase.
Gavin
http://handyrailstips.com
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you
and create a model method called
add_click.
def add_click
increment clicks
end
Then you simply have to call add_click from your controller before
redirecting to amazon.
Gavin
http://handyrailstips.com
--
Posted via http://www.ruby-forum.com
]/
If it returns nil, there's a space, if not then there's no space.
Otherwise I'd go with Colin's approach.
Gavin
http://handyrailstips.com
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed
Haha
Fair enough :)
Marnen Laibow-Koser wrote:
Gavin Morrice wrote:
[...]
If you're specifically looking for a regepxp that will match any thing
that doesn't start with a space then try: /^[^\s]/
I was trying not to spoon-feed the lazy. :)
Best,
--
Marnen Laibow-Koser
http
% to
your view and, if you like, %= auto_discovery_link_tag :rss, rss_path
% to the head/head of your layout
read about the RSS specifications here:
http://cyber.law.harvard.edu/rss/rss.html
Hope that helps?
Gavin
http://handyrailstips.com
--
Posted via http://www.ruby-forum.com
forgot to add...
to parse HTML, check out Hpricot
http://www.rubyinside.com/parse-xml-quickly-and-easily-with-hpricot-166.html
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Hi all
Managed to solve this issue with CodeRay
The site is now up and running - here is a quick tutorial on how I did
it incase anybody else wants to do the same:
http://handyrailstips.com/tips/5-styling-your-blog-s-code-to-look-like-your-favorite-text-editor-with-coderay
:)
@steve
Again, sorry for the late reply.
I built the site with changes in mind, tips can be updated easily
enough so, provided the authors kept them up to date, changes in rails
shouldn't be a problem.
I'll start scouring the forums for some potential tip info - thanks
for the tip!
:)
Vipin,
wouldn't it be better moving this out of the controller altogether?
If every A should have a B then I'd create an observer - AObserver
and add an after_create callback:
class AObserver ActiveRecord::Observer
def after_create(a)
B.create! :a_id = a.id
end
end
wrote:
On May 28, 6:42 pm, Gavin ga...@thinkersplayground.com wrote:
Vipin,
wouldn't it be better moving this out of the controller altogether?
If every A should have a B then I'd create an observer - AObserver
and add an after_create callback:
class AObserver ActiveRecord::Observer
Yep
try...
def test_should_not_be_valid_without_name
user = User.new
user.valid?
assert_equal user.errors.on(:name), Please enter a name
end
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails:
I'd also recommend checking out rspec.
It's a BDD framework that helps you write tests that feel a lot more
intuitive than the default rails testing suite.
simply install the rspec gem and the rspec-rails gem
Specs are written like:
describe User do
it should not be valid without a name do
Hey David
The only thing I can think of here would be to set action mailer to
raise delivery errors in your development and production environments:
config.action_mailer.raise_delivery_errors = true
and then add something like the following to the method that sends the
mail:
def
.
Just create an account and log in.
I hope at least some of you find it useful
handyrailstips.com
Thanks
Gavin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post to this group, send
default_url_options[:host] = mydomain.com
def after_create(post)
Net::HTTP.get('www.google.com', '/ping?sitemap=' + URI.escape
(sitemap_url))
end
end
How could I write a test for this?
Also - how could I disable the actual request while running in test
mode?
Thanks
Gavin
So instead of sending an email after a user is created (for example)
from the observer, It would be better to have the controller send it
or call a model method to send it?
On May 6, 7:19 pm, Phlip phlip2...@gmail.com wrote:
Gavin wrote:
Firstly, after_create should not call the service
Hey all - just wanted to check if I'm going about this in the right
way...
I have class User, user has a password
Password should only be valid if it's between 6 and 16 chars in
length.
New user is created if everything is valid and it's stored to the db.
After saving to the database, the
Hey all
Suppose Post has many comments.
Is it possible to call Post.all and order them by the number of
comments each has without adding a column 'comments_count' to the Post
table?
If not, can anyone think of a nicer way of doing it this than:
def Post.order_by_comments
posts = Post.all
^^ I should add
Is it possible to do this in one SQL query?
Thanks
On May 1, 4:55 pm, Gavin ga...@thinkersplayground.com wrote:
Hey all
Suppose Post has many comments.
Is it possible to call Post.all and order them by the number of
comments each has without adding a column
Gottit - thank you both for clearing that up
--~--~-~--~~~---~--~~
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
all spaces inside code /code tags to nbsp;
I presume using a reg expression is the best way to achieve this, I'm
just not sure of how to word an expression to scan for only characters
within the html tags.
any ideas?
Ta
Gavin
--~--~-~--~~~---~--~~
You received
, Tim mcintyre@gmail.com wrote:
You don't want to fall into the rat hole of parsing HTML with
regexes. You need a parsing library like hpricot or similar.
http://wiki.github.com/why/hpricot
good luck!
Tim
On Apr 29, 11:09 am, Gavin ga...@thinkersplayground.com wrote:
Hi all
I'm
I had planned on formatting the code tags with CSS as you suggested
Rob but I also need to wrap specific words in spans to specify their
colour
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk
Actually...
Just found this = http://coderay.rubychan.de/
looks perfect for my needs
Thanks for your suggestions guys
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post to this
Hey Perry
Managed to sort this out.
The solution was to add a symlink to libMagickCore.so.1 in /usr/
lib.
Thanks a lot for your help
:)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
You could store it in the session hash temporarily?
What is it you're trying to achieve?
--~--~-~--~~~---~--~~
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
PS - although adding the path to .bash_profile works in the shell, it
doesn't work when I start up my app using the facilities provided by
my host
-is that normal?
On Apr 20, 7:59 pm, Wouter de Bie rails-mailing-l...@andreas-s.net
wrote:
Perry Smith wrote:
LD_LIBRARY_PATH may not be
1 - 100 of 171 matches
Mail list logo