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 wrote:
> I forget why but I'm stuck using rubygems 1.7.2, which means I
> occasionally get the dreaded "invalid date format in specif
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/
gems/1.8/specifica
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 pr
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 ne
On Mar 17, 4:39 pm, Philip Hallstrom 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 previe
any before filters clearing it out?
with AJAX, if your rails app is on a different domain than the page
hosting the form the cookies may get blocked resulting in no session
information being available.
On Mar 17, 5:00 pm, radhames brito wrote:
> On Thu, Mar 17, 2011 at 4:54 PM, Tony Primer
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 wrote:
> does it work when you uncomment this line in destroy?
>
> # @cart = current_cart
>
> On Mar 17, 4:31 pm, radhames brito wrote:
&g
does it work when you uncomment this line in destroy?
# @cart = current_cart
On Mar 17, 4:31 pm, radhames brito 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 create
> @c
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 wrote:
> I am new to RoR I have installed aptana, eclipse RoR plugin on ubuntu
> 10.10.
> but whether I create Rub
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 ch
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 ja
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 he
as nothing.
Adding ':value => @test.value1' fixes the issue but shouldn't be
necessary AFAIK
<%= f.text_field :value1, :value => @test.value1 %>
On Feb 11, 10:00 am, Jim Ruther Nill wrote:
> are you sure that heading is nil? could you double check if it's not a
On Feb 11, 8:45 am, Frederick Cheung
wrote:
> On Feb 11, 1:37 pm, Tony Primerano 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? ? 'Ple
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 empt
gine asks sends "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 wrote:
> It should be noted that while adding this fixed m
On Jan 6, 3:04 pm, Marnen Laibow-Koser 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 h
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 wrote:
> TonyPrimeranowrote in post #972234:
>
>
>
> > In the past I have used Net:
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 goe
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 wrote:
> On Jan 3, 2011, at 3:08 PM, Tony Primerano wrote:
>
> > Post.where('draft is NOT true')
>
> That shouldn't work either.
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
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
wrote:
> well. adding
>
> Mime::Type.register &qu
efinition 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 wrote:
> The thunderstone crawler (http://search
I tell my 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
Ton
yeah that works better. :-)
How other gems are handling this.
It looks like acts_as_ferret is only supporting Rails3 in > 0.5 so no
need for version checks there (unfortunately it isn't quite rails 3
ready yet).
On Oct 27, 9:41 am, Tim Shaffer wrote:
> On Oct 27, 9:09 am, Ton
ot;3")
do 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&quo
ax_months).to_a,
item.months)
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)?
Th
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.
http://j-k.lighthouseapp.com/projects/45560-acts-as-ferret/tickets/176-aaf-051-undefined-method-includes_values-for-conditionssymbol#ticket-1
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 widgettypeid').order(:w
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,
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 har
try adding trace to your rake command to get more information
rake rails:upgrade:check --trace
On Sep 3, 5:32 am, Mauro wrote:
> I've installed rails_upgrade plugin with ruby script/plugin
> installhttp://github.com/rails/rails_upgrade.git.
> Then if I run rake rails:upgrade:check it says
> rak
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 wrote:
> Hello,
>
> I have this kind of relation:
>
> class Arti
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 en
test.rb file.
On Sep 2, 9:20 am, Tony Primerano 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'
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. U
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 j
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 wrote:
> On Sep 25, 3:44 pm, Jeff wrote:
>
> > On Sep 25, 2:05 pm, Tony wrote:
>
> > > I suspect th
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
wrote:
> thanks - does Rackspacecloud have Ruby on Rails support (well like
> Dreamhost?), or it a get your own server & do it yours
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
hap
On Sep 25, 3:44 pm, Jeff wrote:
> On Sep 25, 2:05 pm, Tony 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 here.
>
> > def new
> > User.tran
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 wrote:
> I suspect there is a standard way to handle this issue but I haven't
> found it.
>
> In my controller cre
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 wrote:
> Hello friends,
>
> I m using Active Merchant(version = 1.4.2) gem.
> in billing calculator i m require 'active_merchant' and when i
overriding the Movie destroy method works fine for killing 'fixed'
contracts before ActiveRecord makes them null.
At 1st I was thinking of catching the nullify via a callback on the
Contract class (wasn't sure what I was going to do here but it appears
the nullification doesn't invoke the callbac
47 matches
Mail list logo