When working in development mode (using webrick) it is painful waiting for
pages to load when there are a lot of css and js assets that are loaded one
by one.
This has annoyed me for years but today it dawned on me how easy the fix
is. I'm using Rails 4.1.x
in development.rb
Add the digest
Currently I have capistrano in my Gemfile and when I deploy I do
bundle exec cap deploy
I run several rails apps on a single server and their Gemfiles may
differ over time resulting in several installs of capistrano.
I'm wondering if I should just leave capistrano out of the gemfile and
install
/ead8ec8d57331b6b750d1622e5b683763b92fd73#diff-1
The ticket
https://github.com/mpapis/rubygems-bundler/issues/6
On Sep 20, 1:00 pm, Tony Primerano tony.primer...@gmail.com wrote:
I forget why but I'm stuck using rubygems 1.7.2, which means I
occasionally get the dreaded invalid date format
I forget why but I'm stuck using rubygems 1.7.2, which means I
occasionally get the dreaded invalid date format in specification
error message
What sets the date format?
For example. with rubygems-bundler
Invalid gemspec in [/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/
I'm using Rails 3.0.7 / Ruby 1.9.2 and I'm wondering what the
recommended way to generate app docs is.
Running rake doc:app generates good documentation but click to
toggle source doesn't work since rdoc 2.5.8 doesn't support the '--
line-numbers, --inline-source options that the rake task
For some reason I didn't start using mysql2 until recently on my
Rails3/1.9.2 project and I just noticed that this change caused some
of my data to display incorrectly.
I guess the mysql gem doesn't really store data in UTF-8 so I wrote a
migration to fix the broken items.
My question is, do I
Is it possible to have a form submit normally if button X is pushed
and do an AJAX call if button Y is pushed?
My use case:
I'm letting users do some customizations and I want a preview button
and a save button. Hitting preview submits the current form values
as an AJAX call and the returned
The code looks right.
Make sure you don't have class Post defined somewhere else (like
post.last.rb).
Also, make sure you restart the console each time you make changes to
the Post class.
Don't do a reload on the post class from inside the console as this
doesn't work with ActiveRecord last I
Use Netbeans. :-) Or find an Aptana help forum ;-)
I suspect most people here use textmate, I use netbeans and haven't
tried Aptana in over a year
On Mar 17, 1:26 pm, hoboy Hoboy li...@ruby-forum.com wrote:
I am new to RoR I have installed aptana, eclipse RoR plugin on ubuntu
10.10.
but
does it work when you uncomment this line in destroy?
# @cart = current_cart
On Mar 17, 4:31 pm, radhames brito rbri...@gmail.com wrote:
oookk, so i have 2 actions , create and destroy, i can get
session[:cart_id] from inside the create method but not from inside
the delete method.
def
oh wait.. ignore that. of course it will work but it just creates
a new cart. :-\ sorry, long day
On Mar 17, 4:54 pm, Tony Primerano tony.primer...@gmail.com wrote:
does it work when you uncomment this line in destroy?
# @cart = current_cart
On Mar 17, 4:31 pm, radhames brito rbri
, Tony Primerano
tony.primer...@gmail.comwrote:
does it work when you uncomment this line in destroy?
# @cart = current_cart
If i do that what happens is that since the session is nil a new cart i
created and i lose all the items in the original current_cart
and a new cart is rendered
On Mar 17, 4:39 pm, Philip Hallstrom phi...@pjkh.com wrote:
Is it possible to have a form submit normally if button X is pushed
and do an AJAX call if button Y is pushed?
My use case:
I'm letting users do some customizations and I want a preview button
and a save button. Hitting
yeah, i find the docs fairly hard to navigate and I've been doing
this for a while.
Once you figure out where the page is
http://api.rubyonrails.org/classes/ActiveRecord/QueryMethods.html
you'll see that none of the methods have any documentation. :-\
There is information on ARel queries
I have a model and I set defaults for some values by overriding the
read accessor. For example
def heading
read_attribute(:heading).nil? ? 'Please select from:' :
read_attribute(:heading)
end
The problem I have found is that text_field ignores this.
%= f.text_field :heading %
is empty
On Feb 11, 8:45 am, Frederick Cheung frederick.che...@gmail.com
wrote:
On Feb 11, 1:37 pm, Tony Primerano tony.primer...@gmail.com wrote:
I have a model and I set defaults for some values by overriding the
read accessor. For example
def heading
read_attribute(:heading).nil
Primerano
tony.primer...@gmail.comwrote:
On Feb 11, 8:45 am, Frederick Cheung frederick.che...@gmail.com
wrote:
On Feb 11, 1:37 pm, Tony Primerano tony.primer...@gmail.com wrote:
I have a model and I set defaults for some values by overriding the
read accessor. For example
Accept: image/jpg they will
get HTML from me. I tried this on some other sites and they returned
html even if an image was requested so I am no worse than them :-)
On Jan 3, 8:59 am, Tony Primerano tony.primer...@gmail.com wrote:
It should be noted that while adding this fixed my test cases
It looks like HTTParty uses Net::HTTP so I'll just stick with that.
I got burned by so many deprecated gems moving from Rails 2 to Rails 3
that use them sparingly now. :-\
On Jan 4, 10:53 am, Marnen Laibow-Koser li...@ruby-forum.com wrote:
TonyPrimeranowrote in post #972234:
In the past I
On Jan 6, 3:04 pm, Marnen Laibow-Koser li...@ruby-forum.com wrote:
Please quote when replying.
Tony Primerano wrote in post #972913:
It looks like HTTParty uses Net::HTTP so I'll just stick with that.
Stick with *which*?
I'll just call Net::HTTP directly. I have a simple GET request
In the past I have used Net::HTTP to call trivial remote services.
These calls have been low frequency so didn't bother looking into
alternatives.
I'm now looking at a design where I will be calling a remote service
that returns a simple CSV but it will be called frequently and if that
service
. It seems safe to
assume that erb should be used when the Accept header doesn't map to a
specific mime-type. Is there a way to make this happen or is there a
reason this shouldn't be done?
On Dec 31 2010, 6:21 pm, Tony Primerano tony.primer...@gmail.com
wrote:
well. adding
Mime::Type.register text
I feel like I'm missing something obvious here..
I have a Post object and it has a draft attribute. It may be nil,
true or false. I want nil to be treated as false
Post.where(:draft = false) does not pick up the posts where draft is
unset(nil)
This leaves me to query with
Post.where('draft
Yeah. I guess ruby is making me lazy. ;-)
I'll set all my NULLs to false and validate presence.
On Jan 3, 5:42 pm, Scott Ribe scott_r...@killerbytes.com wrote:
On Jan 3, 2011, at 3:08 PM, Tony Primerano wrote:
Post.where('draft is NOT true')
That shouldn't work either. NULL is neither
rails app to treat this as rhtml by
default instead of returning a 500?
Missing template [controller]/[method] with
{:handlers=[:erb, :rjs, :builder, :rhtml, :rxml], :formats=[:text/
*, :js], :locale=[:en, :en]}
I'll post a response if I figure it out
Tony Primerano
--
You received this message
of an HTML
mime type. Probably for the better, any suggestions. I could ping
thunderstone and have them fix their crawler but I'm wondering if
there is a better way Rails an handle this case.
On Dec 31, 4:47 pm, Tony Primerano tony.primer...@gmail.com wrote:
The thunderstone crawler (http
rails 3 stuff
else
do what u were doing
end
Seems like that would break something once Rails 4 comes out. ;-)
Pointers to best practices appreciated. Thanks
Tony Primerano
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post
, Tony Primerano tony.primer...@gmail.com wrote:
Seems like that would break something once Rails 4 comes out. ;-)
Couldn't you do this?
if Rails::VERSION::STRING.to_i = 3
puts at least rails 3
else
puts rails 2 or lower
end
--
You received this message because you are subscribed
)
When I do this I need to do use raw.
%= select_tag months, raw(options) %
Assuming this is WAD the documentation should probably be updated.
Is there a better way to do what I am doing above (adding an option to
the options_for_select output)?
Thanks
Tony Primerano
--
You received
Rails 3 / Ruby 1.9.2
Over the weekend I saw the undefined method `includes_values'
for :conditions:Symbol error for the 1st time while working with
AAF.
In Rails 2 if I wanted to check if an ActiveRecord attribute had an
error on it I simply called
assert user.errors.on(:name)
Now that this is depreciated what is a clean way to do this check?
This is ugly but it works..
assert !user.errors[:name].empty?
remove the negative logic and it
I'm not sure how to do the COUNT(widget_type_id) AS widgettypeid as
this doesn't seem to work below but it is close. hoping someone will
chime in. :-) I'm sure I'm missing something simple.
Widget.group(:widget_type_id).select('widget_type_id,
count(widget_type_id) AS
It appears that cache-money will not work with Rails 3 as-is because
it hooks into 2 active record methods that no longer exist. :-(
alias_method_chain :find_every, :cache
alias_method_chain :find_from_ids, :cache
With the whole ARel integration I wonder if hooking into the DB calls
just got
I've never used sqlserver before but I would start with the
development.log file for clues.
Assuming there is a command line client can you connect to the
database with it? Can you ping your db host mordor? In dev the
host is usually localhost (in linuxland anyway).
On Sep 7, 12:30 pm,
Try this
Factory.define :article do |f|
f.title Hello, world
f.comments {|comments| [comments.association(::comment)]}
end
Factory.define :comment do |f|
f.content Awesome!
end
On Sep 3, 6:07 am, Satsou Sa li...@ruby-forum.com wrote:
Hello,
I have this kind of relation:
try adding trace to your rake command to get more information
rake rails:upgrade:check --trace
On Sep 3, 5:32 am, Mauro mrsan...@gmail.com wrote:
I've installed rails_upgrade plugin with ruby script/plugin
installhttp://github.com/rails/rails_upgrade.git.
Then if I run rake
Is there a way to make Rails.cache.fetch always execute the code block
in the test environment? (disable caching)
For example in my test console on Rails 3
ruby-1.9.2-rc2 Rails.cache.fetch('foo') {'bar'}
= bar
ruby-1.9.2-rc2 Rails.cache.fetch('foo') {'bar44'}
= bar
Caching is on. Using
file.
On Sep 2, 9:20 am, Tony Primerano tony.primer...@gmail.com wrote:
Is there a way to make Rails.cache.fetch always execute the code block
in the test environment? (disable caching)
For example in my test console on Rails 3
ruby-1.9.2-rc2 Rails.cache.fetch('foo') {'bar'}
= bar
ruby
Assuming you are using standard page/fragement/action caching you can
just set
config.action_controller.perform_caching = false
in your development environment file. If you are making direct calls
to Rails.cache you can use a cache store stub in development.
I just did this today for my test
The Cache Money page (http://github.com/nkallen/cache-money) mentions
For your unit tests, it is faster to use a Memcached mock than the real
deal.
Faster is fine but will it work with memcached? It doesn't work with
mine, I suspect the cache is not cleared between tests. I suspect this
is
You get your own server and set it up yourself. Some sysadmin skill
are required but they have some good server setup articles.
On Sep 27, 2:45 am, Greg Hauptmann greg.hauptmann.r...@gmail.com
wrote:
thanks - does Rackspacecloud have Ruby on Rails support (well like
Dreamhost?), or it a get
FYI. It appears there is a ticket on this issue
https://rails.lighthouseapp.com/projects/8994/tickets/2991-after-transaction-patch
On Sep 25, 4:31 pm, Tony Primerano tony.primer...@gmail.com wrote:
On Sep 25, 3:44 pm, Jeff cohen.j...@gmail.com wrote:
On Sep 25, 2:05 pm, Tony tony.primer
actually making the id nil doesn't work either. guess it still has
created_at and updated_at items. Anyway. Is there a simple way to
remedy this issue?
On Sep 25, 3:05 pm, Tony tony.primer...@gmail.com wrote:
I suspect there is a standard way to handle this issue but I haven't
found it.
On Sep 25, 3:44 pm, Jeff cohen.j...@gmail.com wrote:
On Sep 25, 2:05 pm, Tony tony.primer...@gmail.com wrote:
I suspect there is a standard way to handle this issue but I haven't
found it.
In my controller create action I have a Transaction. Lets say I'm
creating a user object
Agreed. Rackspace is great. Especially when you're 1st building your
application. I had apache/passenger and mysql running just fine on a
256MB instance. cost? about $11/month.
http://www.tonycode.com/blog/archives/122
There is EC2 on Rails but AWS starts at about $90/month. I'm really
You'll probably have better luck in the active merchant group
http://groups.google.com/group/activemerchant?lnk=
On Sep 16, 9:31 am, Ghanshyam Rathod rails-mailing-l...@andreas-
s.net wrote:
Hello friends,
I m using Active Merchant(version = 1.4.2) gem.
in billing calculator i m require
46 matches
Mail list logo