Re: [Rails] Rails 3.2 Extending String Core Classe as per Rails doc

2012-11-20 Thread Jordon Bedwell
On Tue, Nov 20, 2012 at 10:46 AM, Erwin yves_duf...@mac.com wrote:
 in yoodle/lib/my_app/core_ext
   String.class_eval do
 def to_squawk
   squawk! #{self}.strip
 end
   end

 and I have added in yoodle/config/application.rb
 config.autoload_paths += Dir[#{config.root}/lib,
 #{config.root}/lib/**/]

 but running in console
 AAA.to_squawk   raises an error
 NoMethodError: undefined method `to_squawk' for AAA:String

 Is there anything else not mentionned in the Rails doc ?

1.) Autloading is for constants not for anything else and it's
preferable you use autoload_once_paths instead of autoload_paths (at
least from my experience, others may differ on opinion and I don't
have any evidence to back up my claims other than what the name
implies and threading and what not.)

2.) Do not class_eval directly onto String, that's bad business,
monkey patching that way is a dirty dirty game and to most it's an
eternal sin... make your own module and do `String.send(:include,
MyModule)` because at least then there is a clear path back to where
it comes from, in your case nobody has any damn idea where the code
comes from therefore they have no real idea how to path it out at all.

__OPINION__

Normally what I do is one method per file patching and one include
file per patch w/ a generic all called patches.rb in the root of lib
that will load all the patches at once, but the former allows people
who take my code to pull specific code without having to dig, I am a
big fan of easy to follow code and code that is designed to be
decoupled (meaning my patches should not rely on each other and I
should be able to include a single and only a single patch if that's
what I want.) This means that I would do:

lib/my_app/core_ext/string/to_squawk.rb  The Patch.
lib/patches/stdlib/string/to_squawk.rb  The file that Patches String.
Here is an example: https://gist.github.com/5984753b60573f416820

__OPINION__

Now, most probably won't like the way I work with my patches some
people love to patch up STDLib like it's their day job and sole job
description so if you don't then what you need to do is just require
the file (lib is included in your load path by default in Rails) and
the patch will work but I think you should still fix that whole dirty
dirty way of patching in your method.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Ubuntu-x-swat] [Bug 969860] Re: fglrx uses 100% CPU when screen turns off (spinning in glXWaitVideoSyncSGI or glXSwapBuffers)

2012-11-19 Thread Jordon Bedwell
Crap, I had a strong suspicion this was the case because I too didn't
experience this bug in 12.10 but 12.10 did not really appeal to my
tastes (because of some personal reasons that aren't necessary to this
bug.) I don't remember if I ever mentioned that in another bug or not.

Just as a side request if you could, can you please report the default
settings for 12.10 for the settings you changed.  I actually prefer to
keep my desktop tearfree and knowing what those settings are by default
in 12.10 will help me a long with plenty of others who want to keep
tearfree.  (I remember keeping tearfree enabled and not having the
problem in 12.10 but the case might have changed since I tested it
before Quantal was released and in beta1)

Thanks for taking the time to look into this deeper, and I'm sorry if I
sounded angry earlier, I just really wanted updates on the matter and
you surely did provide updates that show me peeps care!

-- 
You received this bug notification because you are a member of Ubuntu-X,
which is subscribed to fglrx-installer in Ubuntu.
https://bugs.launchpad.net/bugs/969860

Title:
  fglrx uses 100% CPU when screen turns off (spinning in
  glXWaitVideoSyncSGI or glXSwapBuffers)

To manage notifications about this bug go to:
https://bugs.launchpad.net/compiz/+bug/969860/+subscriptions

___
Mailing list: https://launchpad.net/~ubuntu-x-swat
Post to : ubuntu-x-swat@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-x-swat
More help   : https://help.launchpad.net/ListHelp


[Desktop-packages] [Bug 969860] Re: fglrx uses 100% CPU when screen turns off (spinning in glXWaitVideoSyncSGI or glXSwapBuffers)

2012-11-19 Thread Jordon Bedwell
Crap, I had a strong suspicion this was the case because I too didn't
experience this bug in 12.10 but 12.10 did not really appeal to my
tastes (because of some personal reasons that aren't necessary to this
bug.) I don't remember if I ever mentioned that in another bug or not.

Just as a side request if you could, can you please report the default
settings for 12.10 for the settings you changed.  I actually prefer to
keep my desktop tearfree and knowing what those settings are by default
in 12.10 will help me a long with plenty of others who want to keep
tearfree.  (I remember keeping tearfree enabled and not having the
problem in 12.10 but the case might have changed since I tested it
before Quantal was released and in beta1)

Thanks for taking the time to look into this deeper, and I'm sorry if I
sounded angry earlier, I just really wanted updates on the matter and
you surely did provide updates that show me peeps care!

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to fglrx-installer in Ubuntu.
https://bugs.launchpad.net/bugs/969860

Title:
  fglrx uses 100% CPU when screen turns off (spinning in
  glXWaitVideoSyncSGI or glXSwapBuffers)

Status in Compiz:
  Invalid
Status in Compiz 0.9.8 series:
  Invalid
Status in Compiz Core:
  Invalid
Status in AMD fglrx video driver:
  Unknown
Status in The Ubuntu Power Consumption Project:
  Fix Released
Status in “compiz” package in Ubuntu:
  Invalid
Status in “fglrx-installer” package in Ubuntu:
  Confirmed
Status in “fglrx-installer-updates” package in Ubuntu:
  Confirmed
Status in “gnome-shell” package in Ubuntu:
  Invalid

Bug description:
  WORKAROUND (1):
  1. Open Catalyst Control Center.
  2. Go to 3D  More Settings.
  3. Set Wait for vertical refresh to On, unless application specifies.
  And if that doesn't work, then also do:
  4. Run ccsm
  5. In Workarounds, enable Force full screen redraw (buffer swap) on repaint.

  WORKAROUND (2):
  1. Run ccsm (from package compizconfig-settings-manager)
  2. In OpenGL  Sync To VBlank = OFF

  TEST CASE:
  1. Monitor compiz CPU usage (from /proc/pid of compiz/stat or top in batch 
mode)
  2. In brightness and lock settings set Turn screen off when inactive to 1 
minute
  3. Wait until screen turns off
  4. Move mouse or press a key to turn screen back on
  5. Check the CPU usage from the monitor

  ACTUAL RESULT:
  When screen turns off compiz goes to 100%
  When the screen turns back on, cpu usage drops immediately to a normal value
  The graph attached shows %CPU of compiz with a sample per second. The graph 
has been captured on a system with  a Radeon HD5770 and fglrx if that matter

  ProblemType: Bug
  DistroRelease: Ubuntu 12.04
  Package: compiz 1:0.9.7.2-0ubuntu4
  ProcVersionSignature: Ubuntu 3.2.0-21.34-generic 3.2.13
  Uname: Linux 3.2.0-21-generic x86_64
  NonfreeKernelModules: fglrx
  .tmp.unity.support.test.0:

  ApportVersion: 2.0-0ubuntu1
  Architecture: amd64
  CompizPlugins: 
[core,composite,opengl,compiztoolbox,decor,vpswitch,snap,mousepoll,resize,place,move,wall,grid,regex,imgpng,session,gnomecompat,animation,fade,unitymtgrabhandles,workarounds,scale,expo,ezoom,unityshell]
  CompositorRunning: compiz
  Date: Sat Mar 31 10:17:48 2012
  DistUpgraded: 2012-02-01 00:15:24,616 DEBUG enabling apt cron job
  DistroCodename: precise
  DistroVariant: ubuntu
  MachineType: Gigabyte Technology Co., Ltd. GA-890GPA-UD3H
  PackageArchitecture: all
  ProcEnviron:
   TERM=xterm
   PATH=(custom, user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.2.0-21-generic 
root=UUID=cf89ba34-108b-404d-9804-32d54a1df2ea ro quiet splash vt.handoff=7
  SourcePackage: compiz
  UpgradeStatus: Upgraded to precise on 2012-01-31 (59 days ago)
  dmi.bios.date: 07/23/2010
  dmi.bios.vendor: Award Software International, Inc.
  dmi.bios.version: FD
  dmi.board.name: GA-890GPA-UD3H
  dmi.board.vendor: Gigabyte Technology Co., Ltd.
  dmi.board.version: x.x
  dmi.chassis.type: 3
  dmi.chassis.vendor: Gigabyte Technology Co., Ltd.
  dmi.modalias: 
dmi:bvnAwardSoftwareInternational,Inc.:bvrFD:bd07/23/2010:svnGigabyteTechnologyCo.,Ltd.:pnGA-890GPA-UD3H:pvr:rvnGigabyteTechnologyCo.,Ltd.:rnGA-890GPA-UD3H:rvrx.x:cvnGigabyteTechnologyCo.,Ltd.:ct3:cvr:
  dmi.product.name: GA-890GPA-UD3H
  dmi.sys.vendor: Gigabyte Technology Co., Ltd.
  version.compiz: compiz 1:0.9.7.2-0ubuntu4
  version.fglrx-installer: fglrx-installer N/A
  version.ia32-libs: ia32-libs N/A
  version.libdrm2: libdrm2 2.4.32-1ubuntu1
  version.libgl1-mesa-dri: libgl1-mesa-dri 8.0.2-0ubuntu3
  version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
  version.libgl1-mesa-glx: libgl1-mesa-glx 8.0.2-0ubuntu3
  version.xserver-xorg-core: xserver-xorg-core 2:1.11.4-0ubuntu8
  version.xserver-xorg-input-evdev: xserver-xorg-input-evdev 1:2.7.0-0ubuntu1
  version.xserver-xorg-video-ati: xserver-xorg-video-ati 
1:6.14.99~git20111219.aacbd629-0ubuntu2
  

[Bug 969860] Re: fglrx uses 100% CPU when screen turns off (spinning in glXWaitVideoSyncSGI or glXSwapBuffers)

2012-11-19 Thread Jordon Bedwell
Crap, I had a strong suspicion this was the case because I too didn't
experience this bug in 12.10 but 12.10 did not really appeal to my
tastes (because of some personal reasons that aren't necessary to this
bug.) I don't remember if I ever mentioned that in another bug or not.

Just as a side request if you could, can you please report the default
settings for 12.10 for the settings you changed.  I actually prefer to
keep my desktop tearfree and knowing what those settings are by default
in 12.10 will help me a long with plenty of others who want to keep
tearfree.  (I remember keeping tearfree enabled and not having the
problem in 12.10 but the case might have changed since I tested it
before Quantal was released and in beta1)

Thanks for taking the time to look into this deeper, and I'm sorry if I
sounded angry earlier, I just really wanted updates on the matter and
you surely did provide updates that show me peeps care!

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/969860

Title:
  fglrx uses 100% CPU when screen turns off (spinning in
  glXWaitVideoSyncSGI or glXSwapBuffers)

To manage notifications about this bug go to:
https://bugs.launchpad.net/compiz/+bug/969860/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1080722] Re: Immediate restart nearly forced by Update-Manager 12.10

2012-11-19 Thread Jordon Bedwell
*** This bug is a duplicate of bug 1033226 ***
https://bugs.launchpad.net/bugs/1033226

Nearly is subjective IMO.  While I think the behavior can/should change
I don't think it's forced at all.  Much like Windows it allows you to
minimize it but it makes sure to (try and) keep itself inside your view
so that you are reminded.  One thing you have to admin is that unlike
Windows at least it doesn't pop up every 4 hours (at maxmum) with a
timer that restarts for you even if you are unaware causing you to lose
work.

Maybe take a mid-Windows style approach where a user can set a timer to
remind them (as they are working) but unlike Windows don't have that
timer have a timer that auto-restarts without your knowledge or telling
it, I feel it's time to restart.  I personally like that approach
because more often than not I will want to be reminded (and the red gear
icon hints at me too) but I don't want to be reminded while I'm working,
but if it pops up anytime while I'm not working I would be more than
happy to oblidge.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1080722

Title:
  Immediate restart nearly forced by Update-Manager 12.10

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/1080722/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


Re: [Rails] Forcing a reload for all user sessions

2012-11-19 Thread Jordon Bedwell
On Mon, Nov 19, 2012 at 4:53 AM, David M idav...@gmail.com wrote:
 I'm storing some user info in session (like the name, using cookies), in
 Ruby on Rails 3.2

 Let's suppose the user opens the site in two different browsers, and logs
 He changes his name in one browser, and switches to the other browser and
 refreshes the page. The second browser still shows the old name, because
 it is stored in session.

 How can I force a refresh in all sessions? Is this possible?

IMO it's on the user at that point.  Don't muddle yourself with
details like that when it's their own problem and something that would
require (possibly depending on how you go about it) significant code
changes that could drastically affect performance.

Depending on how you go about it anyways, normally you would hit the
database everytime anyways and later with some clever side jobs to
pull and commit and update cached records later (or other ways it
really depends on the developer,) why not just use the ActiveRecord
object you pull and show their name? There are cases where you
wouldn't do that but such as a userless site that just stores their
name in a cookie to preference the site but you can't really control
that situation at all.

What I am saying is there are several ways you can go about it, one is
to switch to ActiveRecord sessions and add an extra key (username)
that is only used to find and delete sessions when a user updates
their record, this would kill all possible sessions but adds extra
overhead in terms of the username and even extra overhead in terms of
ActiveRecord (but then again this is more secure and you could even
get clever and pull from Memcached and delay the commit and memcached
update with delayed_job reducing impact on the user.)

The third way would be to just update the session when you pull their
record from ActiveRecord based on their user_id in the session which
is just as well the same as just using the ActiveRecord object, except
in that case you reduce your code count a littlebit because then you
don't need to update the session.

Maybe somebody else has better ideas but this is what comes up in my head.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Ubuntu for Android

2012-11-19 Thread Jordon Bedwell
On Mon, Nov 19, 2012 at 6:56 PM, Chris Mosetick cmoset...@gmail.com wrote:
 Hi James,
 I too would like to know where to get a Ubuntu for Android phone. Good find
 on the new video. At the moment, hardware wise it still seems like vapor.
 Let me know if you find out any details. FWIW, I'm in the U.S., but I'm all
 about international shipping if I need to go that route. James, join me in
 #ubuntu-android on Freenode if you would like to exchange more thoughts
 sometime.

https://wiki.ubuntu.com/Nexus7/Installation
http://www.engadget.com/2012/10/27/ubuntu-nexus-7-installer/

-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss


[Ubuntu-x-swat] [Bug 969860] Re: fglrx uses 100% CPU when screen turns off (spinning in glXWaitVideoSyncSGI or glXSwapBuffers)

2012-11-18 Thread Jordon Bedwell
Why is this constantly being pushed? And being pushed at all, this is a
pretty critical issue that breaks quite a few laptops, I don't even
understand why you would ignore an issue like this and push it instead
of making it a top priority issue...

-- 
You received this bug notification because you are a member of Ubuntu-X,
which is subscribed to fglrx-installer in Ubuntu.
https://bugs.launchpad.net/bugs/969860

Title:
  fglrx uses 100% CPU when screen turns off (spinning in
  glXWaitVideoSyncSGI or glXSwapBuffers)

To manage notifications about this bug go to:
https://bugs.launchpad.net/compiz/+bug/969860/+subscriptions

___
Mailing list: https://launchpad.net/~ubuntu-x-swat
Post to : ubuntu-x-swat@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-x-swat
More help   : https://help.launchpad.net/ListHelp


[Desktop-packages] [Bug 969860] Re: fglrx uses 100% CPU when screen turns off (spinning in glXWaitVideoSyncSGI or glXSwapBuffers)

2012-11-18 Thread Jordon Bedwell
Why is this constantly being pushed? And being pushed at all, this is a
pretty critical issue that breaks quite a few laptops, I don't even
understand why you would ignore an issue like this and push it instead
of making it a top priority issue...

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to fglrx-installer in Ubuntu.
https://bugs.launchpad.net/bugs/969860

Title:
  fglrx uses 100% CPU when screen turns off (spinning in
  glXWaitVideoSyncSGI or glXSwapBuffers)

Status in Compiz:
  Triaged
Status in Compiz 0.9.8 series:
  Triaged
Status in Compiz Core:
  Triaged
Status in The Ubuntu Power Consumption Project:
  Fix Released
Status in “compiz” package in Ubuntu:
  Triaged
Status in “fglrx-installer” package in Ubuntu:
  Confirmed
Status in “fglrx-installer-updates” package in Ubuntu:
  Confirmed
Status in “gnome-shell” package in Ubuntu:
  Confirmed

Bug description:
  WORKAROUND (1):
  1. Open Catalyst Control Center.
  2. Go to 3D  More Settings.
  3. Set Wait for vertical refresh to On, unless application specifies.
  And if that doesn't work, then also do:
  4. Run ccsm
  5. In Workarounds, enable Force full screen redraw (buffer swap) on repaint.

  WORKAROUND (2):
  1. Run ccsm (from package compizconfig-settings-manager)
  2. In OpenGL  Sync To VBlank = OFF

  TEST CASE:
  1. Monitor compiz CPU usage (from /proc/pid of compiz/stat or top in batch 
mode)
  2. In brightness and lock settings set Turn screen off when inactive to 1 
minute
  3. Wait until screen turns off
  4. Move mouse or press a key to turn screen back on
  5. Check the CPU usage from the monitor

  ACTUAL RESULT:
  When screen turns off compiz goes to 100%
  When the screen turns back on, cpu usage drops immediately to a normal value
  The graph attached shows %CPU of compiz with a sample per second. The graph 
has been captured on a system with  a Radeon HD5770 and fglrx if that matter

  ProblemType: Bug
  DistroRelease: Ubuntu 12.04
  Package: compiz 1:0.9.7.2-0ubuntu4
  ProcVersionSignature: Ubuntu 3.2.0-21.34-generic 3.2.13
  Uname: Linux 3.2.0-21-generic x86_64
  NonfreeKernelModules: fglrx
  .tmp.unity.support.test.0:

  ApportVersion: 2.0-0ubuntu1
  Architecture: amd64
  CompizPlugins: 
[core,composite,opengl,compiztoolbox,decor,vpswitch,snap,mousepoll,resize,place,move,wall,grid,regex,imgpng,session,gnomecompat,animation,fade,unitymtgrabhandles,workarounds,scale,expo,ezoom,unityshell]
  CompositorRunning: compiz
  Date: Sat Mar 31 10:17:48 2012
  DistUpgraded: 2012-02-01 00:15:24,616 DEBUG enabling apt cron job
  DistroCodename: precise
  DistroVariant: ubuntu
  MachineType: Gigabyte Technology Co., Ltd. GA-890GPA-UD3H
  PackageArchitecture: all
  ProcEnviron:
   TERM=xterm
   PATH=(custom, user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.2.0-21-generic 
root=UUID=cf89ba34-108b-404d-9804-32d54a1df2ea ro quiet splash vt.handoff=7
  SourcePackage: compiz
  UpgradeStatus: Upgraded to precise on 2012-01-31 (59 days ago)
  dmi.bios.date: 07/23/2010
  dmi.bios.vendor: Award Software International, Inc.
  dmi.bios.version: FD
  dmi.board.name: GA-890GPA-UD3H
  dmi.board.vendor: Gigabyte Technology Co., Ltd.
  dmi.board.version: x.x
  dmi.chassis.type: 3
  dmi.chassis.vendor: Gigabyte Technology Co., Ltd.
  dmi.modalias: 
dmi:bvnAwardSoftwareInternational,Inc.:bvrFD:bd07/23/2010:svnGigabyteTechnologyCo.,Ltd.:pnGA-890GPA-UD3H:pvr:rvnGigabyteTechnologyCo.,Ltd.:rnGA-890GPA-UD3H:rvrx.x:cvnGigabyteTechnologyCo.,Ltd.:ct3:cvr:
  dmi.product.name: GA-890GPA-UD3H
  dmi.sys.vendor: Gigabyte Technology Co., Ltd.
  version.compiz: compiz 1:0.9.7.2-0ubuntu4
  version.fglrx-installer: fglrx-installer N/A
  version.ia32-libs: ia32-libs N/A
  version.libdrm2: libdrm2 2.4.32-1ubuntu1
  version.libgl1-mesa-dri: libgl1-mesa-dri 8.0.2-0ubuntu3
  version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
  version.libgl1-mesa-glx: libgl1-mesa-glx 8.0.2-0ubuntu3
  version.xserver-xorg-core: xserver-xorg-core 2:1.11.4-0ubuntu8
  version.xserver-xorg-input-evdev: xserver-xorg-input-evdev 1:2.7.0-0ubuntu1
  version.xserver-xorg-video-ati: xserver-xorg-video-ati 
1:6.14.99~git20111219.aacbd629-0ubuntu2
  version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.17.0-1ubuntu4
  version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 
1:0.0.16+git20111201+b5534a1-1build2

To manage notifications about this bug go to:
https://bugs.launchpad.net/compiz/+bug/969860/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp


[Bug 969860] Re: fglrx uses 100% CPU when screen turns off (spinning in glXWaitVideoSyncSGI or glXSwapBuffers)

2012-11-18 Thread Jordon Bedwell
Why is this constantly being pushed? And being pushed at all, this is a
pretty critical issue that breaks quite a few laptops, I don't even
understand why you would ignore an issue like this and push it instead
of making it a top priority issue...

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/969860

Title:
  fglrx uses 100% CPU when screen turns off (spinning in
  glXWaitVideoSyncSGI or glXSwapBuffers)

To manage notifications about this bug go to:
https://bugs.launchpad.net/compiz/+bug/969860/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


Re: [Rails] rake test:units error because not null constraint.

2012-11-18 Thread Jordon Bedwell
On Sun, Nov 18, 2012 at 1:42 PM, Mauro mrsan...@gmail.com wrote:
 Hello.
 I have this unit test:

 test User validations do
   user = User.new
   assert user.invalid?
   assert user.errors[:uid].any?
   assert user.errors[:name].any?
   assert user.errors[:role].any?
 end

You should probably move each of those assertions to a test of their
own using contexts.

describe User do
  context Validations
it should have an error on blah
  end
end

But you can make those kind of tests mad easy by just using should
matchers then it comes down to something so simple you never forget to
properly do it:

describe User do
  it { should validate_presence_of(:name) }
end


 When I run it I have this error:

 null value in column uid violates not-null constraint: INSERT INTO
 users (created_at, updated_at, id) VALUES ('2012-11-18
 19:37:39', '2012-11-18 19:37:39', 298486374).
 In the fixture user I've put:

 one:
   uid: xxx.xxx

If I remember right you should be doing users(:one) instead of
User.new but I'm not so sure on that subject 100% because I haven't
played with Fixtures since the day after I started learning Rails and
discovered factory_girl.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Compiz] [Bug 969860] Re: fglrx uses 100% CPU when screen turns off (spinning in glXWaitVideoSyncSGI or glXSwapBuffers)

2012-11-18 Thread Jordon Bedwell
Why is this constantly being pushed? And being pushed at all, this is a
pretty critical issue that breaks quite a few laptops, I don't even
understand why you would ignore an issue like this and push it instead
of making it a top priority issue...

-- 
You received this bug notification because you are a member of compiz
packagers, which is subscribed to compiz in Ubuntu.
https://bugs.launchpad.net/bugs/969860

Title:
  fglrx uses 100% CPU when screen turns off (spinning in
  glXWaitVideoSyncSGI or glXSwapBuffers)

To manage notifications about this bug go to:
https://bugs.launchpad.net/compiz/+bug/969860/+subscriptions

___
Mailing list: https://launchpad.net/~compiz
Post to : compiz@lists.launchpad.net
Unsubscribe : https://launchpad.net/~compiz
More help   : https://help.launchpad.net/ListHelp


[Ubuntu-x-swat] [Bug 969860] Re: fglrx uses 100% CPU when screen turns off (spinning in glXWaitVideoSyncSGI or glXSwapBuffers)

2012-11-17 Thread Jordon Bedwell
While we're at it, can anyone update us on the status of this bug in
Precise? When I tested it on Quantal it was working exactly as intended
with no side-affects like this so I'm wondering if there are plans to
fix this soon? Since it seems like it didn't make it into the point.

-- 
You received this bug notification because you are a member of Ubuntu-X,
which is subscribed to fglrx-installer in Ubuntu.
https://bugs.launchpad.net/bugs/969860

Title:
  fglrx uses 100% CPU when screen turns off (spinning in
  glXWaitVideoSyncSGI or glXSwapBuffers)

To manage notifications about this bug go to:
https://bugs.launchpad.net/compiz/+bug/969860/+subscriptions

___
Mailing list: https://launchpad.net/~ubuntu-x-swat
Post to : ubuntu-x-swat@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-x-swat
More help   : https://help.launchpad.net/ListHelp


[Desktop-packages] [Bug 969860] Re: fglrx uses 100% CPU when screen turns off (spinning in glXWaitVideoSyncSGI or glXSwapBuffers)

2012-11-17 Thread Jordon Bedwell
While we're at it, can anyone update us on the status of this bug in
Precise? When I tested it on Quantal it was working exactly as intended
with no side-affects like this so I'm wondering if there are plans to
fix this soon? Since it seems like it didn't make it into the point.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to fglrx-installer in Ubuntu.
https://bugs.launchpad.net/bugs/969860

Title:
  fglrx uses 100% CPU when screen turns off (spinning in
  glXWaitVideoSyncSGI or glXSwapBuffers)

Status in Compiz:
  Triaged
Status in Compiz 0.9.8 series:
  Triaged
Status in Compiz Core:
  Triaged
Status in The Ubuntu Power Consumption Project:
  Fix Released
Status in “compiz” package in Ubuntu:
  Triaged
Status in “fglrx-installer” package in Ubuntu:
  Confirmed
Status in “fglrx-installer-updates” package in Ubuntu:
  Confirmed
Status in “gnome-shell” package in Ubuntu:
  Confirmed

Bug description:
  WORKAROUND (1):
  1. Open Catalyst Control Center.
  2. Go to 3D  More Settings.
  3. Set Wait for vertical refresh to On, unless application specifies.
  And if that doesn't work, then also do:
  4. Run ccsm
  5. In Workarounds, enable Force full screen redraw (buffer swap) on repaint.

  WORKAROUND (2):
  1. Run ccsm (from package compizconfig-settings-manager)
  2. In OpenGL  Sync To VBlank = OFF

  TEST CASE:
  1. Monitor compiz CPU usage (from /proc/pid of compiz/stat or top in batch 
mode)
  2. In brightness and lock settings set Turn screen off when inactive to 1 
minute
  3. Wait until screen turns off
  4. Move mouse or press a key to turn screen back on
  5. Check the CPU usage from the monitor

  ACTUAL RESULT:
  When screen turns off compiz goes to 100%
  When the screen turns back on, cpu usage drops immediately to a normal value
  The graph attached shows %CPU of compiz with a sample per second. The graph 
has been captured on a system with  a Radeon HD5770 and fglrx if that matter

  ProblemType: Bug
  DistroRelease: Ubuntu 12.04
  Package: compiz 1:0.9.7.2-0ubuntu4
  ProcVersionSignature: Ubuntu 3.2.0-21.34-generic 3.2.13
  Uname: Linux 3.2.0-21-generic x86_64
  NonfreeKernelModules: fglrx
  .tmp.unity.support.test.0:

  ApportVersion: 2.0-0ubuntu1
  Architecture: amd64
  CompizPlugins: 
[core,composite,opengl,compiztoolbox,decor,vpswitch,snap,mousepoll,resize,place,move,wall,grid,regex,imgpng,session,gnomecompat,animation,fade,unitymtgrabhandles,workarounds,scale,expo,ezoom,unityshell]
  CompositorRunning: compiz
  Date: Sat Mar 31 10:17:48 2012
  DistUpgraded: 2012-02-01 00:15:24,616 DEBUG enabling apt cron job
  DistroCodename: precise
  DistroVariant: ubuntu
  MachineType: Gigabyte Technology Co., Ltd. GA-890GPA-UD3H
  PackageArchitecture: all
  ProcEnviron:
   TERM=xterm
   PATH=(custom, user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.2.0-21-generic 
root=UUID=cf89ba34-108b-404d-9804-32d54a1df2ea ro quiet splash vt.handoff=7
  SourcePackage: compiz
  UpgradeStatus: Upgraded to precise on 2012-01-31 (59 days ago)
  dmi.bios.date: 07/23/2010
  dmi.bios.vendor: Award Software International, Inc.
  dmi.bios.version: FD
  dmi.board.name: GA-890GPA-UD3H
  dmi.board.vendor: Gigabyte Technology Co., Ltd.
  dmi.board.version: x.x
  dmi.chassis.type: 3
  dmi.chassis.vendor: Gigabyte Technology Co., Ltd.
  dmi.modalias: 
dmi:bvnAwardSoftwareInternational,Inc.:bvrFD:bd07/23/2010:svnGigabyteTechnologyCo.,Ltd.:pnGA-890GPA-UD3H:pvr:rvnGigabyteTechnologyCo.,Ltd.:rnGA-890GPA-UD3H:rvrx.x:cvnGigabyteTechnologyCo.,Ltd.:ct3:cvr:
  dmi.product.name: GA-890GPA-UD3H
  dmi.sys.vendor: Gigabyte Technology Co., Ltd.
  version.compiz: compiz 1:0.9.7.2-0ubuntu4
  version.fglrx-installer: fglrx-installer N/A
  version.ia32-libs: ia32-libs N/A
  version.libdrm2: libdrm2 2.4.32-1ubuntu1
  version.libgl1-mesa-dri: libgl1-mesa-dri 8.0.2-0ubuntu3
  version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
  version.libgl1-mesa-glx: libgl1-mesa-glx 8.0.2-0ubuntu3
  version.xserver-xorg-core: xserver-xorg-core 2:1.11.4-0ubuntu8
  version.xserver-xorg-input-evdev: xserver-xorg-input-evdev 1:2.7.0-0ubuntu1
  version.xserver-xorg-video-ati: xserver-xorg-video-ati 
1:6.14.99~git20111219.aacbd629-0ubuntu2
  version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.17.0-1ubuntu4
  version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 
1:0.0.16+git20111201+b5534a1-1build2

To manage notifications about this bug go to:
https://bugs.launchpad.net/compiz/+bug/969860/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp


[Bug 969860] Re: fglrx uses 100% CPU when screen turns off (spinning in glXWaitVideoSyncSGI or glXSwapBuffers)

2012-11-17 Thread Jordon Bedwell
While we're at it, can anyone update us on the status of this bug in
Precise? When I tested it on Quantal it was working exactly as intended
with no side-affects like this so I'm wondering if there are plans to
fix this soon? Since it seems like it didn't make it into the point.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/969860

Title:
  fglrx uses 100% CPU when screen turns off (spinning in
  glXWaitVideoSyncSGI or glXSwapBuffers)

To manage notifications about this bug go to:
https://bugs.launchpad.net/compiz/+bug/969860/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Compiz] [Bug 969860] Re: fglrx uses 100% CPU when screen turns off (spinning in glXWaitVideoSyncSGI or glXSwapBuffers)

2012-11-17 Thread Jordon Bedwell
While we're at it, can anyone update us on the status of this bug in
Precise? When I tested it on Quantal it was working exactly as intended
with no side-affects like this so I'm wondering if there are plans to
fix this soon? Since it seems like it didn't make it into the point.

-- 
You received this bug notification because you are a member of compiz
packagers, which is subscribed to compiz in Ubuntu.
https://bugs.launchpad.net/bugs/969860

Title:
  fglrx uses 100% CPU when screen turns off (spinning in
  glXWaitVideoSyncSGI or glXSwapBuffers)

To manage notifications about this bug go to:
https://bugs.launchpad.net/compiz/+bug/969860/+subscriptions

___
Mailing list: https://launchpad.net/~compiz
Post to : compiz@lists.launchpad.net
Unsubscribe : https://launchpad.net/~compiz
More help   : https://help.launchpad.net/ListHelp


Re: [Rails] Re: How can I prevent ENTER from submitting form?

2012-11-15 Thread Jordon Bedwell
On Thu, Nov 15, 2012 at 10:23 AM, Albert Català li...@ruby-forum.com wrote:
 Easy and clean, thanks you

If you want/need to prevent enter from submitting a form, you are
doing it wrong and you could be be alienating some disabled people who
do not use a mouse and rely on their keyboard.  I know even if that's
not the case, if I ran into a site that prevented me from pressing
enter to submit a form (because I am still a tab, tab, enter person) I
would walk away from that site and probably blacklist it in my
personal DNS.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] in standby for an annoying problem.

2012-11-15 Thread Jordon Bedwell
On Thu, Nov 15, 2012 at 10:37 AM, Colin Law clan...@googlemail.com wrote:
 Experimentation shows me that you are right, that is a bit of rails
 magic that I was not aware of.  In fact it seems that one can call any
 class method on an ActiveRecord relation for the class.  Thanks for
 the education.

It's one of my favorite things to do with ActiveRecord, especially
when storing certain types of records in things like Memcached where
security is more of a cocern to me than a database (in that it has no
scoped ACL like our db's) so I always do something like only with a
where or find_by_* especially since arel (or it might be activerecord
itself) is smart enough to build the entire query long before the last
method in the chain.

 So the question is, is there any significant difference between a
 scope with a lambda and a class method performing the same operation?

From my own experience it depends, sometimes it could be a matter of
just reordering your chain in some cases it might not work at all.
One would have to provide scenarios for a question like this because
it's really up in the air with such a broad scope.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] in standby for an annoying problem.

2012-11-15 Thread Jordon Bedwell
On Thu, Nov 15, 2012 at 11:15 AM, Colin Law clan...@googlemail.com wrote:
 I was trying to ask the general question, that if one has a scope and
 a class method that perform exactly the same operation (such as the
 example in this thread), so

 scope :today_reservations, lambda {   where(reserved_from  ? and
 reserved_to = ?, Date.today,  Date.today ) }

 and

 self.today_reservations
   where(reserved_from  ? and reserved_to = ?, Date.today,  Date.today ) }
 end

 Is there actually any difference between the two, or is the former
 just a way of defining the latter in a railsy sort of way?

From what I remember briefly while playing (since I have always
preferred the latter) scope is like attr_writer and attr_reader in
that it's all the same in the end one just gives you more control over
the flow, the other does it all for you but in the end, the result is
exactly the same.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] best practices in methods

2012-11-13 Thread Jordon Bedwell
On Tue, Nov 13, 2012 at 6:22 AM, rodrigo coutinho
rodrigo.coutinh...@gmail.com wrote:
 Consider this code, it gets a mention and an array of tags.
 It finds the mentions and add the tags.
 But in my methods I keep using return if foo.nil?
 or execute a line of code if a line is not nil.
 Is there a better way of doing this kind of thing?
 Thks

 def add_tags_to_mention mention_id, *tags
 mention = Mention.find mention_id
 return if mention.nil?
 tags.each do |tag_id|
 tag = Tag.find tag_id
 mention.tags.push(tag.to_mongo) if tag
 end
 end

Personally I would handle that a bit differently in that I would have
the model handle building it's own tags and I would inject an array []
and then delete_if value blank? but to address your concern directly:

I would never return nil unless I have to.  I know quite a few Ruby
programmers do not care about that situation but I always return
false, true or the value of the value I processed... there are a lot
of cases where I will also to opt to just raise but that really
depends... in your situation I would have built it on the model as
Mention.build_and_save_tags and then had it raise if it could not find
the mention because to me that makes the most sense.  What I am saying
is to me `return false if mention.blank?` makes more sense to me.  I
could go on a long explanation a mile long explaining the difference
between situations and why I chose my flow to work those ways but I'll
just leave it at I would prefer false before nil.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] How can I change the notice to a text with a variable

2012-11-12 Thread Jordon Bedwell
redirect_back_or_to(:users, notice: Welcome, #{@user.username})

Though you shouldn't do that in the redirect, you should probably just
make that a default part of the view if the session has a user_id.

On Mon, Nov 12, 2012 at 5:19 AM, roelof rwob...@hotmail.com wrote:
 Hello,

 I have this controller :

 class UserSessionsController  ApplicationController
   skip_before_filter :require_login, :except = [:destroy]
   def new
 @user = User.new
   end

   def create
 respond_to do |format|
   if @user = login(params[:username],params[:password])
 format.html { redirect_back_or_to(:users, :notice = 'login
 successfull') }
 format.xml { render :xml = @user, :status = :created, :location =
 @user }
   else
 format.html { flash.now[:alert] = Login failed.; render :action =
 new }
 format.xml { render :xml = @user.errors, :status =
 :unprocessable_entity }
   end
 end
   end

   def destroy
 logout
 redirect_to(:users, :notice = 'Logged out!')
   end
 end

 What's the best way to change login successfull to Welcome , username
 where username is the name the user logs in.

 Regards,

 Roelof

 --
 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+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/rubyonrails-talk/-/V5Ca2VfYRw8J.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] NEW TO PHP...RUBY ON RAILS?

2012-11-11 Thread Jordon Bedwell
On Sun, Nov 11, 2012 at 9:33 AM, Hassan Schroeder
hassan.schroe...@gmail.com wrote:
 You need to learn several languages and frameworks as part of
 becoming a reasonably competent programmer.

 The more diverse the better, but the exact choices are up to you :-)

Jack of all trades, master of none.  I think such a broad statement
leads him in the wrong path. I think he needs to learn a single
language and master it before he even starts to learn another language
and then decide which would be most beneficial to his career.  I'm not
saying you're wrong, actually you are spot on, I just don't want to
see him take on the task of learning multiple languages and once and
then end up the guy that nobody wants because he knows a little bit
about everything and a whole lot about nothing.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Re: Hosting costs for a small up!

2012-11-10 Thread Jordon Bedwell
On Sat, Nov 10, 2012 at 6:02 PM, Matt Jones al2o...@gmail.com wrote:
 Costs can go up pretty quick on Heroku, but your application doesn't sound
 like it would need a whole lot of resources. If nothing else, starting out
 on the free plans on Heroku will provide you with a better understanding of
 how much server you'll actually need.

Put your basic arithmetic skills where your words are and prove
that... instead of being so broad that it's pretty much FUD.  Here let
me start you out in a ghetto system like Heroku:

1xBalancer ($20 a month + Bandwidth) = Router, 1xMicro Server ($15 a
month) = Application Server, 1xMicro Server ($15 a month) = Database
Server. Total cost at Heroku for the same = $0, of your own $45 +
Bandwidth

Lets jump up to 2 Dynos:

1xBalancer ($20 a month + Bandwidth) = Router, 1xMicro Server ($15 a
month) = Application Server, 1xMicro Server ($15 a month) =
Application Server, 1xMicro Server ($15 a month) = Database Server.
Total cost at Heroku for the same = $35, of your own $65 + Bandwidth.

Lets jump up to 3 Dynos:

1xBalancer ($20 a month + Bandwidth) = Router, 1xMicro Server ($15 a
month) = Application Server, 1xMicro Server ($15 a month) =
Application Server, 1xMicro Server ($15 a month) = Application
Server., 1xMicro Server ($15 a month) = Database Server, Total cost at
Heroku for the same = $70, of your own $80.

At 4 dynos you have a choice to make, because realistically you will
start hitting limits, that could happen as soon as 3 dynos maybe
sooner depending on the site.  So at 4 dynos lets design it a bit
different (and round up and use the industry average of 750 to
calculate cost.)

1xBalancer ($20 a month + Bandwidth) = Router, 1xSmall Server ($50 a
month) = Application Server, 1xSmall Server ($50 a month) =
Application Server, 1xSmall Server ($50 a month) = Database Server,
Total cost at Heroku for similar = $157 ($50 for the Crane), of your
own $170 (with micro, it's $130 only a $27 savings.)

Now, there comes a point where you make a choice, do you need more
data or do you need more concurrency.  What I mean by that is, do you
rely on your db more than you rely on your application? For some sites
(like Twitter) this is the clear case, so you have a choice to make
there, do you use Heroku for it all? Or do you save a crap tonne of
money and use your own AWS for the database and Heroku for the routing
and application hosting?  The only way to weigh that cost is to factor
in sysops.  People often forget that sysops is a major part of
platform design, without them your design will more than likely fail
eventually or turn into your fulltime job killing your dev.

There is also the need to factor in db design, Heroku knows how to do
db's, they pay some very smart people who have worked on Postgres
themselves to help them design it.  Do you really think they can't do
it better than you?  Are you willing to scrap the duplication they
offer as well as off-site backups (more than likely) to save some
money?

People don't leave Heroku because of price, it's not expensive, people
leave Heroku because of infrastructure needs, at some point you end up
deciding it's more beneficial to have your own sysops managing your
own infrastructure on AWS than to rely on Heroku, that reason is
entirely your own and most of the time it's completely valid
(sometimes it's just ignorant assumption that it's cheaper to run your
own servers.  In the op's case it could be cheaper depending on how he
plays the AWS card get clever.)

* Note all prices are based on you just ordering a server, not you
reserving it like Heroku does at that point the math costs and it
really depends on whether you'll use the entire year or not (because
really, the discount is only worth it if you buy a year of
reservation.)  They also don't factor in any sysops costs.. There are
always sysops costs, and even if it's your own time you assume is
free, time is money, money is wasted if you spend more time doing
sysops than devops (if you are the developer), hell, money is wasted
if you have to do sysops period, because that's less time doing
meaningful refactors to add in features.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] What to use .haml or .erb ?

2012-11-07 Thread Jordon Bedwell
On Wed, Nov 7, 2012 at 4:35 AM, Иван Бишевац ivan.bise...@gmail.com wrote:
 I use both, but prefer haml, because it's concise.

I normally give clients a decision when the project starts (or make my
own based on what they express their technical skill to be at the
start of a project.) In short what I tell clients is Do you know much
about HTML? Does learning something new really bug you or do you want
to work with what you know? Those two questions help me decide
whether to use HAML which is concise like the above quote states or
use ERB which has a far less learning curve and for technology
disinclined people who know basic HTML, does not lock them out of
their own views.

For the performance issues, to me that matters not one bit considering
I do fragment caching and I do full caching depending on the page so
at that point the argument is moot, unless you are dynamically serving
every one of your pages dynamically which is ignorant to do even on a
small site.  So in short the issues about speed in my eyes are
immature and ignorant to modern caching techniques for dynamic sites.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Rails app slower on a new Dell with Ubuntu than on an old Mac

2012-11-07 Thread Jordon Bedwell
How are you compiling it? What are the packages you used to compile
it? What version of Ubuntu?

On Wed, Nov 7, 2012 at 3:28 PM, Osledy Bazó osledyb...@gmail.com wrote:
 Hello people, I have a problem but im not sure if is a problem at all.

 I've been working in a client project using a macbook pro for two years now.
 The project is a rails 2.1.2 app that we are upgrading, it has a lot of
 tests unit/functional/integration/cucumber
 The complete test suite runs slower on a new Dell manchine that on the old
 Mac. Is that normal?

 The specs for the mac are:

 2008 macbook pro, lion 10.7.2
 8gb ram, 2.53Ghz Core2Duo, 250hd


 The specs for the dell are:

 New Dell xps 15 (new model that came out this year)
 8gb ram, IntelCore™ i7-3632QM, 720hd
 It has Ubuntu 12.04 64bit.


 I have installed ruby ree with rvm in both laptops
 they have the same gems versions managed with bundler

 The mac the tests time:

 unit
 real 9m23.025s
 user 3m42.044s
 sys 1m40.441s


 cucumber
 real 13m3.981s
 user 8m46.322s
 sys 1m24.287s


 The dell the tests time:

 unit
 real 35m4.003s
 user 2m52.155s
 sys  0m58.388s

 cucumber
 real 28m54.349s
 user 6m32.773s
 sys  0m44.751s


 Dell times are slow, is there something im missing? is this normal?

 --
 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+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/rubyonrails-talk/-/4nhGObvq1M4J.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Re: How to open PDF file in browser ?

2012-11-07 Thread Jordon Bedwell
On Wed, Nov 7, 2012 at 10:21 PM, Rajesh reddy rajeshn...@gmail.com wrote:
 give :disposition = 'inline' in your controllers

There are several quirks with sending inline to most browsers (for
example if I remember right Firefox is still plagued by not using the
name you set for inline) and IE has several bugs that used to exist
but I don't know if that's the case.  I would suggest you send it as
an attachment and let the client decide what they want to do, actually
IMO you should always send it as an attachment no matter what because
it should be up to the client what they want to do, that's why the
open with exists.

Adobe can catch them even if they are attached on Windows, on Linux
you won't want to view it inline anyways (at least I never do I prefer
to view it in my client rather than the browser -- or to send it
straight to Google Docs for viewing later.)

send_data(file, type: application/pdf, disposition: attachment;
filename=file.pdf)

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: MRI 2.0 preview release

2012-11-05 Thread Jordon Bedwell
On Mon, Nov 5, 2012 at 1:26 AM, Lucas Nussbaum lu...@lucas-nussbaum.net wrote:
 Looking at the content of your mail, it seems obvious that you don't
 understand why this 'mess' is necessary. I suggest you dig into the list
 archives before telling us what to do.

Are we jumping off hinge, getting butt hurt and making assumptions
like a teenage girl for no reason? Because it doesn't seem obvious,
you didn't read it at all, and it seems obvious I do, read it again,
comprehension helps quite a bit, or actually just reading it and not
stopping at mess and assuming I am talking bad about Debian, but
that is the typical stance of a Debian maintainer, to get butt hurt
and cry the second they see something negative instead of seeing the
context behind it and understanding it's not that negative at all.
Here, let me point out a key part of the statement /to explain to
clients why/.  It's not complicated, it's easy.


-- 
To UNSUBSCRIBE, email to debian-ruby-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/cam5xqnyrhogb10flm6km3hsxogxr3y_xw131v+cqp+a8cva...@mail.gmail.com



Re: EFF Privacy; hopefully Ubuntu will listen to users

2012-11-05 Thread Jordon Bedwell
On Mon, Nov 5, 2012 at 8:55 AM, Robie Basak robie.ba...@canonical.com wrote:
 Forks happen when people disagree. Is there really any disagreement
 here? Have any privacy-related patches actually been rejected, or is it
 just that nobody has written them?

Patches being rejected are a bit narrow, when the Canonical lead
implies (at least to me and a few others) he does not care about
privacy in the default install and has not answered the many numerous
complaints with nothing more than We are not violating the law and
even going as far as ignoring the NTP issue... he speaks louder than
rejecting patches on a tracker.  This is from my perspective though
and I have not really followed all too closely since I am the type of
person to remove what I don't want and block stuff like Canonical's
NTP and other tracking via our hardware firewalls instead of
complaining about stuff that I myself can fix.  But to me and a few
others it's come to the point where it's becoming a side job and
eventually a lot of users will just take out.

 We've just had the Ubuntu Developer Summit during which the next release
 was planned, and everyone was welcome (both in person and online). I
 must have missed the session on privacy, or did nobody propose one?

I don't think there was one, I think this is a case of the few
speaking and protecting the many and the few not having the same power
as the many because some people won't do anything until the many step
up and embarrass the top brass.  What I am saying is, at this point I
am to believe that Canonical and Ubuntu do not care one bit about this
privacy cock up and they don't care that the few notice and are trying
to help the many.  They are probably gonna hold off until the many
step up and embarrass Canonical.

I think what Canonical and Ubuntu are doing is alienating old Linux
users who are used to telling their computers what to do, not having
their computer tell them what they are going to do and then them
having to step up and almost be like no, fu** that noise, you will do
what I want, not what you want. (and again, this is from my
perspective, do feel free to correct me with pure fact if this is not
the case)

-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss


Re: EFF Privacy; hopefully Ubuntu will listen to users

2012-11-05 Thread Jordon Bedwell
On Mon, Nov 5, 2012 at 11:14 AM, Jeremy Bicha jer...@bicha.net wrote:
 One example is http://pad.lv/1065652 which while obviously a user
 interface change, happened after Final Freeze without the typical
 paperwork; presumably because it was *that* critical to mitigate the
 privacy concerns.

I think you are starting intermingle and confuse the difference
between addressing privacy concerns and avoiding a lawsuit by adding
in legal notices, the latter has nothing to do with the former and the
latter only addresses the concerns of Canonical and Ubuntu.  Even if
you try to argue it addresses anything, it's not. Realize the truth.

-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss


Re: [Rails] How to test recaptcha in localhost?

2012-11-02 Thread Jordon Bedwell
Hi,

On Fri, Nov 2, 2012 at 12:44 AM, Fahim Patel pafa...@gmail.com wrote:
 I follow All the steps for recaptcha , but i am confused how to test on my
 local host.
 Q  What should i enter in domain url ?

Don't, mock the entire reCaptcha part
http://rubydoc.info/gems/rspec-mocks/frames

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] How to test recaptcha in localhost?

2012-11-02 Thread Jordon Bedwell
Hi,

On Fri, Nov 2, 2012 at 1:34 AM, Fahim Patel pafa...@gmail.com wrote:
 But when i enter a captcha value , user registration is failing.
 So it is possible to run recaptcha on localhost or i have to deploy me code
 in production .

My guess is it's most likely not reCaptcha that's failing but
something else, gem install pry-rails and add a binding.pry into the
method causing the issue and make sure it is, since reCaptcha works in
the browser via localhost by default (as per Google specs) I would
believe first that it's something else causing the issue.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Re: Newbie - deployment, hosting

2012-11-02 Thread Jordon Bedwell
On Fri, Nov 2, 2012 at 1:39 AM, Adnan adnan.a...@gmail.com wrote:
 How about Appfog??

Maybe once they learn that MySQL is not as cool as they want it to be,
I understand we can choose Postgres after the fact but having an
unbound MySQL instance on my app would get pretty annoying since I
like concise and not cluttered.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Re: Newbie - deployment, hosting

2012-11-02 Thread Jordon Bedwell
On Fri, Nov 2, 2012 at 4:13 AM, Alessio Peternelli
alessio.peterne...@gmail.com wrote:
 - Engine Yard and Amazon Ec2 are Clud Hostings, Amazon EC2 is better but
 complex, EY is expensive.

EngineYard uses EC2 so I don't see what the difference could be?
Unless you are comparing a PaaS with a IaaS which is flawed from the
get go, that would be like comparing a Chicken to an Apple as the best
source of protein.  By that I mean they both have protein obviously
but one is designed to be a primary protein, the other isn't.

It's more expensive because it's a PaaS and they have costs too,
especially those associated with helping developers do systems
management.  Do you think sysops is cheap do you think it's free?  In
an environment like that with high-end apps you pay high-end prices
that or you end up with no SLA and no guarantee.

 My advice ? Go for the cheaper, make some experience and then change to a
 serious one!

In for a rude awakening when that day comes, better services that tend
to cost more always have a far superior deploy method and far
different deploy method then most simple hosts that use CPanel to
manage their Ruby.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] What is Formtastic and SimpleForm gem ? Is any one of this is by default included in Rails ?

2012-10-31 Thread Jordon Bedwell
Hi,

On Wed, Oct 31, 2012 at 1:35 AM, Fahim Patel pafa...@gmail.com wrote:
 Q 1  Is any one of this is by default included in Rails ?

No.

 Q2   Any advantage of this gems over  simple form tags ?

For me, most of the time there is not, actually they add overhead IMO
(at least for my purposes) so I actually just build meta-form-wrapper
helpers that generate generic left_text_area and other methods like it
that just add the classes I need for forms and wrap the section's
around the generic helpers that Rails already provides. That is,
instead of including another dependency that I don't need, but for
some people they bring great benefit because they can handle HTML from
step 1 to end, I don't like that because I prefer to directly control
every bit of output my app makes.

Only you can evaluate whether or not they are worth it, it's a battle
of your own to fight, I can honestly say I would use them if I
actually had a use for them, and many people will agree they have a
use for them, but I personally don't have a use for them so I choose
not to use them.  You have to evaluate that for yourself.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] css background not showing

2012-10-31 Thread Jordon Bedwell
On Wed, Oct 31, 2012 at 1:28 AM, wragen22 bradwr...@gmail.com wrote:
Hi,

 for some reason adding the following is doing nothing...

Please note this list is for Rails questions, not HTML/CSS questions.

 .post.hover  {
 background: FAFAFA;

FAFAFA is not a valid value for background, and you should be using
background-color if you only have a colour just for semantics but to
directly address your question, please try doing #fafafa, please also
note that the pseudo class for hover is :hover so try .post:hover
instead of .post.hover.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Update manager mandating rebooting

2012-10-31 Thread Jordon Bedwell
On Wed, Oct 31, 2012 at 12:00 PM, Daniel J Blueman dan...@quora.org wrote:
 I was thinking along the lines of we have something in the indicator area to
 avoid forgetting to reboot. Point is, it's almost certainly not a convenient
 time to reboot after you just opened up to get something actually done and
 update manager scans in the background and find updates.

There is already something in the indicator that indicates a restart
is needed, your gear icon will turn red and warn you that you need to
restart, it does that for me even though I refuse to use update
manager (I'm old, and always in the terminal, I like my apt cookies
daily.)  When you click the gear icon it also says a restart or reboot
is needed.

 Of course, Debian derivatives relaunch background services. A desktop
 notification should be present to notify the user that a logout _or_ reboot
 is needed. There's just no need to reboot unless upstart is vulnerable (and
 then it doesn't publish services on the network).

That's a subjective point of view, if libssl is vulnerable or the
kernel is vulnerable you need to restart too, not because you can't
restart services or use a rolling Kernel (read KSplice) but because
there are multiple ways to look at it, from my perspective a login and
logout is just as fast as a reboot (because reboot requires less steps
for me since again I'm already in my terminal and my laptop boots at
blazing speeds.)  I would much rather reboot than trust a system that
assumes it knows every possible service that could be using a
vulnerable lib reliably and reboot them.  It's easier that way. Easy
is good but easy shouldn't be annoying like what you describe happens
with update manager when you update .

-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss


Re: [Rails] [JOB] Rails Developer - Denver Colorado

2012-10-30 Thread Jordon Bedwell
On Tue, Oct 30, 2012 at 2:43 AM, hanish jadala
emailtohoneyr...@gmail.com wrote:
 can you give your mail id to send Resume

Already failed.  Look at the bottom of his email.  Also, if you could
miss that what would you miss in your code?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Newbie - deployment, hosting

2012-10-30 Thread Jordon Bedwell
On Tue, Oct 30, 2012 at 10:54 AM, Dave Aronson
googlegroups2d...@davearonson.com wrote:
 On Tuesday, October 30, 2012, Dmitry Maksyoma wrote:
 Maybe if you have a large app, but it sounded like the app in question was a
 typical small learner app.  In that case, he can likely host it there for
 free.  Can't get much cheaper than that.  ;-)

I agree with you totally man. Not to mention Heroku only gets
expensive before you add in the tax on sysops. One might might
ignorantly assume that Heroku is expensive but in essence it's a lot
cheaper.  At 2 dynos which is $35... to have the same setup of your
own would cost you twice as much.

To get 3 dynos having the same setup of your own only saves you around
$11 but after that one would need a systems administrator to manage
all these instances or at least a part time one to help you manage the
infrastructure that manages those -- that is unless you put it all on
one server, then there is no helping you anyways -- that or you like
to waste time not programming by managing your own clusters which is
fine by me but at that point you would save money at a cost of
development time which still ends up costing you money in the end, in
some way.

So what I am saying is, once somebody starts factoring in all the
costs, Heroku isn't all that expensive compared to what you could be
paying by doing it yourself, people choose to go their own route
because of infrastructure needs not because of the price of Heroku..
because people who actually plan out the numbers and look at Heroku's
infrastructure start to realize just how much it isn't expensive.

This is all based off of a single site and not something like a system
like Heroku that you manage on your own for your clients because the
other could lead to quite a few cost savings in some places but IMO it
probably won't be enough to justify the huge startup cost.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Re: Rails Installer Problem

2012-10-29 Thread Jordon Bedwell
Install github for Windows so it will manage your keys and everything
for you automatically, it's truly the easiest way to Work with git on
Windows if it's your first time with Git.

On Mon, Oct 29, 2012 at 12:25 PM, Norbert Melzer timmel...@gmail.com wrote:
 Where your ssh dir is, aber depends on your version of windows, the used ssh
 client and if you are using cygwin or msys or non of them.

 So please give some more details about your environment.

 Am 29.10.2012 15:47 schrieb Colm Ginty cgi...@tcd.ie:

 I wonder if you could tell me how to find the 'ssh directory'. I've looked
 and looked and can't find the key in my RoR files. I have the same problem
 where the command prompt line told me that the ssh key had copied to my
 clipboard but  in fact it hadn't.

 On Sunday, July 24, 2011 9:15:12 PM UTC+1, Luis Lavena wrote:

 On Jul 23, 10:38 pm, frandan...@gmail.com frandan...@gmail.com
 wrote:
  So I decided to go through this process for setting the key described
  on the github site...
 
  http://help.github.com/win-set-up-git/
 
  ...That all went well, but it still gives me the same error:
 
  C:\Sites\ridemogit push -u origin master
  Permission denied (publickey).
  fatal: The remote end hung up unexpectedly
 

 You need to upload your public key to GitHub.

 That should be inside .ssh directory in your user folder.

 --
 Luis Lavena

 --
 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+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/rubyonrails-talk/-/jol-U_mnYjcJ.
 For more options, visit https://groups.google.com/groups/opt_out.



 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] JSON response , error message

2012-10-28 Thread Jordon Bedwell
On Sun, Oct 28, 2012 at 12:26 AM, Saravanan P
saravana...@shriramits.com wrote:
 render :json = { :errors = @example.errors.full_messages }, :status = 422

Why are you sending a 422?  If you really want to stick in the 400
range it would be more suitable to send a 409 conflict since it
literally is a conflict but some just prefer to stick to a generic
500.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] How to use Ajax with rails ?

2012-10-26 Thread Jordon Bedwell
On Fri, Oct 26, 2012 at 10:38 AM, Fahim Patel pafa...@gmail.com wrote:
 Hi all,

Can any one tell me how to use Ajax with Rails.
 Send me quick start up link and videos.

Include jquery-rails and do it like you normally would.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Re: My first database model - would you look at it pls?

2012-10-24 Thread Jordon Bedwell
On Wed, Oct 24, 2012 at 12:39 PM, Dave Aronson
googlegroups2d...@davearonson.com wrote:
 On Wed, Oct 24, 2012 at 1:00 PM, Kevin McCaughey li...@ruby-forum.com wrote:

 As for the Bookings table, the reasoning behind this is in case there
 are multiple meetings going on in the same building, at the same time -
 there needs to be a way to differentiate them. If I simply use a room
 number, then we still have the issue of a many to many for
 Meeting-Place. So, I thought that rather than just do a straight join
 table, I could logically separate the meetings into bookings (if that
 makes sense).

 I am looking at all this from the staff point of view - I want staff
 (Person) to be able to fill in a time-table for their weeks and someone
 else be able to view meetings happening (i.e. a manager has a look at
 what his staff are doing for the week, can look at any one member of
 staff at a given point of time to see where they should be, are they
 safe etc).

 As for keeping track of the rooms, I am not too worried about that.

 H.  I'm thinking that in order to minimize conflicts due to typos
 (someone books the Smythe room, but the next clerk doesn't know it's
 spelled that way, and books the Smith room), and simplify the Bookings
 stuff, I'd probably:

I wonder if something like that couldn't be address with PostgreSQL
and hstore where you store a null hstore hash that has common names
NAME2=NULL,NAME2=NULL, since searching that is easy.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Error occured while evaluating nil

2012-10-21 Thread Jordon Bedwell
On Sun, Oct 21, 2012 at 10:20 AM, Muhammad Salman li...@ruby-forum.com wrote:
 This is the code

 if !params[:ratings].nil?
 params[:ratings].each_key do |r|
 @selected_ratings  r
 @movies  Movie.where('rating = :rating', :rating = r)
 @sort = params[:sort]
   end
 elsif
 @selected_ratings = @all_ratings
 @movies = Movie.order(@sort)
 @sort = params[:sort]
 end

if !params[:ratings].blank?  params[:ratings].is_a?(Array)
  params[:ratings].each do |rating|
(@selected_ratings ||= [])  rating
@sort = params[:sort]
(@movies ||= [])  Movie.where(rating = ?, rating)
  end
else
  @selected_ratings = @all_ratings
  @sort = params[:sort]
  @movies = Movies.order(@sort)
end

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Is it possible to store the log file by day?

2012-10-21 Thread Jordon Bedwell
On Sun, Oct 21, 2012 at 5:29 PM, Victor Goff keeperotpho...@gmail.com wrote:
 Can you use logrotate or whatever the OS gives for rotating logs?

Yes I agree you should be using logrotate because most logging in
applications is not rotated by them, but instead by logrotate, this
way you can easily adjust the time between your logging, for example I
rotate all my logs hourly some people do it daily, some monthly.  If
this were to happen in every application it would become a pretty
annoying task imo.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] limitations of passing a block to class_eval

2012-10-19 Thread Jordon Bedwell
On Fri, Oct 19, 2012 at 8:28 PM, John Merlino stoici...@aol.com wrote:
 One shortcoming of define_method is that it does not allow you to
 specify a method body that expects a block. If you need to dynamically
 create a method that accepts a block, you will need to use the def
 statement within class_eval. Here's a trivial example:

Why are you using define_method inside of class eval again?   That set
aside I hope you are not learning Ruby on 1.8.7 because that would
defeat the purpose of learning Ruby, since 1.8.7 is pretty much dead
and 1.9.3 is where you should start, since hopefully no company will
ever ask you to do Ruby on 1.8.7 that said, ruby does in-fact support
blocks in define_method see:

class MyClass
  define_method(:my_method1) do |block|
if !block
  raise No block given
end

block.call
  end
end

MyClass.new.my_method1 do
  $stdout.puts Hello World
end

-

class MyClass
  class_eval do
define_method(:my_method1) do |block|
  block.call
end
  end
end

MyClass.new.my_method1 do
  $stdout.puts Hello World
end

 If the method you are creating is sufficiently dynamic, you may not
 be able to pass a block to class_eval and will instead have to specify
 the method definition as a string to be evaluated.

 I'm not sure what they are talking about here. What does it mean by
 sufficiently dynamic? In my example above, I proved that a method
 defined within the context of class_eval can accept a block.

What they are talking about is complicated logic vs simple logic, when
you are aliasing a helper into sub-helpers (for example color(color)
gets meta-programmed in a loop to def black; color(#000) end) that
is simple logic, then you have complicated logic, which involves
morphing entire sets of meta-methods based on variables and using
those variables in the meta too.  An example of that is
https://github.com/envygeeks/mongoid-find_by/blob/master/lib/mongoid/finders/find_by.rb#L21
 that can morph dynamically into find_by_field1_and_field2(field1,
field2) or find_by_field1(field1) and (hopefully) any mixture of _and_
or find_all_by +- _and_ you want and define the method for you.  That
is the difference between just doing a simple block and doing a
string.

A good tip though, if you are /just/ learning Ruby, stay away from
meta-programming, because it's the devil in disguise as a blessing,
what I mean is it's all fun until somebody gets poked in the eye.
It's really great but some people overkill it, rape it, hang it out to
dry, rape it again, and then throw it in the trash after murdering it
because it ends up so complicated that it's just not worth managing
anymore. As a beginner meta-programmed tends to get abused, the same
thing happens with monkey-patching with beginners, it absolutely gets
abused and you wouldn't believe how many people I see monkey patch
directly onto STDLib instead of doing at worst a class and then
including it, but whatever.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Re: Not all javascript files for asset pipeline:

2012-10-18 Thread Jordon Bedwell
On Wed, Oct 17, 2012 at 7:22 PM, Soichi Ishida li...@ruby-forum.com wrote:
 Thanks everyone. I was worried about both server and client but
 especially about the client side.

 Sounds like I should not be worried about it too much.

Now days Javascript parser themselves are pretty efficient, the only
problem I worry about with Javascript is how much I'm loading at once,
and that's not to do with processing but more load time, if I can load
1kb vs 10kb I will go that route because even though most of us don't
like to admit it, some people still do have bad 3G and even dial-up or
satellite that isn't so stable on speed.  So I always reduce how much
I'm loading at once if I can, meaning I treat my front-end like I
treat my back-end I only load and use what I absolutely need not what
I think will be cool and if I can pull in the cool pieces without a
larger dependency I will.  What I mean by that is I actually take
specific pieces from Gems and just put them in the lib, or I pull
specific pieces from Javascript libraries and load them pieces myself.

Another side rant on the same subject that some people should actually
worry about: The other thing I worry about is what some companies like
Twitter do which is activate the GPU for no reason other than
rendering CSS animations (which isn't even necessary on a modern
computer unless you do quite a few things) or other stuff which isn't
always needed at all and in some cases makes things lock up (for a
split second) on some smart phones.

It makes it even worse when you mix bootstrap with Chrome on Linux
which has a huge bug in GPU rendering (with FGLRX and in some cases
even Nvidia) in that any page that is rendered by the GPU is
completely broken.  So if you are worried about the client, disable
the GPU enabled parts of your CSS or warn your users to disable the
GPU usage in Chrome.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Why is max-age in config.static_cache_control being ignored?

2012-10-18 Thread Jordon Bedwell
On Wed, Oct 17, 2012 at 9:15 PM, Cary Cherng cche...@gmail.com wrote:
 In config/environments/production.rb I have set

 config.serve_static_assets = true
 config.static_cache_control = public, max-age=1000

If I remember right, anything served from /app/assets is not
considered static to the system because it requires more to route it,
but anything in /public should be considered a static asset and will
fall under your cache control.  Since I normally handle all my headers
via Apache or Nginx I don't remember if this is entirely the case
anymore but again if I remember right everything again in /app/assets
is considered compiled on the fly unless you compile it to /public.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] NameError?

2012-10-18 Thread Jordon Bedwell
On Thu, Oct 18, 2012 at 9:38 AM, wragen22 bradwr...@gmail.com wrote:
 Extracted source (around line #7):

 4:
 5:% @posts.each do |status| %
 6:div class=post
 7:strong%= post.title %/strong
 8:/div
 9:
 10:   % end %

Took me all of 0.1 seconds to
notice that you have @posts.each o |status| instead of @posts.each do
|post| which means you haven't even told it that post should be the
variable in that closure, status is the current.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Default group

2012-10-18 Thread Jordon Bedwell
On Thu, Oct 18, 2012 at 4:31 AM, Nicolas Michel
be.nicolas.mic...@gmail.com wrote:
 To be honnest I never gave a try to Ubuntu One, probably for bad
 conservative reasons. I will try it. But I still feel that even if you're
 right that pushing things into the cloud make things simpler, there are
 still some flaws :

Most of these flaws are always subjective, except when it comes to
security, since UbuntuOne still does not have encryption (from last I
heard) it's not a viable solution for people who need to backup secure
documents, and it comes at a cost too since AmazonS3 now supports
built-in encryption without the need of a 3rd party source.  It comes
at even more of a cost when people realize that s3fs is not hard to
use at all.  I don't know why Canonical or Ubuntu or whoever owns it
does not see these problems but whatever, I'm not their CTO.

 - what if we don't have access to internet and only want to share on the

Then you share the folder via LAN while still allowing UbuntuOne to
Sync.  Ubuntu does not prevent you from accessing the folder at all,
or doing what you want with it, except renaming it, you do have to
play a little bit of filesystem trickery to rename it as a normal
user.

 - what with DLNA ? Are users needs to be technical guys to be able to use.

What has DLNA got to do with normal file storage? It's not content
hosting.  Unless they started with it recently and went CDN which
would be pretty amazing considering they have no support for things
like the WD Live, Sony/Samsung/LG Blueray or others but a quick Google
search suggests they are not a content provider.

 - of course I think about the speed. To come-back on my earlier exemple in a
 gaming LAN : what if I want to share some Gigs of data to others in the same
 LAN? It can't be done through Ubuntu One I guess? Although technical
 solutions exists to do it (and really the most simple seems to me webdav - a
 pretty good solution I think but until now it's usage never really
 took-off).

Speed is more or less on your end, if Canonical is smart they will
geo-host via AWS (that is unless they build their own infrastructure
then you would hope they still zone.) If they are on AWS they have
access to a pipes bigger by 10x if not more than anything you could
get for less than 10-50K (1-50K realistically depending on the type of
servers they get) a month unless you are in KC (or North California)
and manage to convince Google to make your area a Fibrehood.

Nobody is stopping you from sharing gigs of data though.  If you are
suggesting using it for storing games and what-have-you so called
live-data then that's on you because no storage service like Ubuntu
one is designed for that sort of thing, that requires an entirely
different stack design, one that thinks about what happens between
point a and point b and not one that only wants you to make it to
point b.  People often assume that servers are the same, they are not.

-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss


Re: [Rails] Re: form tag is self-closing before input fields .. (HAML generator used)

2012-10-17 Thread Jordon Bedwell
On Wed, Oct 17, 2012 at 2:37 AM, Colin Law clan...@googlemail.com wrote:
 On 16 October 2012 23:15, Erwin yves_duf...@mac.com wrote:
 Thanks , I had that feeling... I'll test it by tomorrow ...  is there
 any links related to this being illegal ? just for my notetaker
 pad ...

 If ever you have any markup and you just want to check whether it is
 legal you can paste it into the w3c html validator and it will check
 it for you.  In fact any time a page is misbehaving in a strange way
 it is a good idea to check the html for validity, and before any page
 is made public it should be checked.  Even if a page looks ok there
 may still be invalid html there which can make it perform differently
 on different browsers.

Since I didn't see the rest of this I'll just comment as if it's
future-proofed markup.  In HTML5 form / simply means form, it's a
grey area, it's not allowed but it's parsed and even has parsing rules
but it means form so you will end up with a parsing error eventually
possibly.  It has parsing rules because of XML and XHTML.  It does not
mean form/form like most people assume.

While I agree with Colin that you should check with the W3 validator I
also think that you should take any of the HTML5 markup validations
with a grain of salt and refer to the spec
http://dev.w3.org/html5/spec/ because there are grey areas that will
get you later.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Re: form tag is self-closing before input fields .. (HAML generator used)

2012-10-17 Thread Jordon Bedwell
On Wed, Oct 17, 2012 at 3:34 AM, Colin Law clan...@googlemail.com wrote:
 I don't understand what you mean by it's not allowed.  If it parses
 without an error then how can it not be allowed?  Or are you pointing
 out that the spec is inconsistent?

 Why would one want to do form / anyway?

That's exactly what I mean by a grey area, it's one of those things
that you're not supposed to do, it's not allowed but they allow it
to parse and pass because it's so popular and because it was so widely
used prior to HTML5 via XHTML from XML, that and it's converted to
tag which is perfectly valid in some circumstance. I don't quite
remember if there was intent to make it fully illegal but right now
it's a grey area in that it parses but you are not supposed to do it
because it's not allowed in HTML5.

TL;DR

form / - form = valid but could lead to parse error because of
nesting issues.
form / is not legal in HTML5 but parsed and passed because of
syntactic sugar and XML.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Not all javascript files for asset pipeline:

2012-10-17 Thread Jordon Bedwell
On Wed, Oct 17, 2012 at 6:47 AM, Soichi Ishida li...@ruby-forum.com wrote:
 Not all javascript files are necessary for every page of app.
 If I put all JavaScript files in app/assets/javascripts/ , all of them
 are compiled and read in every page.  I believe this is a waste of
 memory space and CPU load.

Why are you serving assets from Rails /period/ without caching if you
are so worried about CPU load?  I would be more worried about the user
load time than my own CPU usage on a server for such a trivial action
(trivial because you can cache it to a static file)

 Is there anyway to avoid it?

Stop requiring the appname.js file since it uses sprockets to require
the entire tree, include each individual file.  Or you could adjust
the appname.js file and stop it from requiring each asset in the tree
but I prefer just to delete it entirely and include the specific files
I need.

Example: %= javascript_include_tag :jquery %
On some:
% if @page  @page.role == :post %
  %= javascript_include_tag :jquery %
% end %

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] 401 Unauthorized

2012-10-17 Thread Jordon Bedwell
On Wed, Oct 17, 2012 at 8:17 AM, Saravanan P saravana...@shriramits.com wrote:
 I creating both web site and mobile app. For this i am using common database
 to store data for both web site and mobile app.
 I developing mobile app through phonegap. While i submit form and try to
 store data through mobile app, i am getting 401 Unauthorized errors.

I don't know about the rest of the people here but I do not feel like
whipping out my wand and casting spells to see your code and logs
(been a long day) so could you please post some code or logs, we can't
help without at least the most basic of diagnostic information.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] generate 10 UUID records and save it it database in rails

2012-10-17 Thread Jordon Bedwell
On Wed, Oct 17, 2012 at 8:34 AM, ruby rails li...@ruby-forum.com wrote:
 I need to create certain number of  UUId records(based on the selection
 of drop down) and save it in the database. Now I am generating only one
 unique id. Can this be done in the model in this way. Or do I need to
 write a helper file for that??

  def generate_unique_token=(value)self.secret =
  Base64.encode64(UUIDTools::UUID.random_create)[0..8] end

 In my controller...

 def create
  @secretcode= Secretcode.new(params[:secretcode])
  @user= User.new(params[:user])
  @secretcode.user_id=@user
 @secretcode.generate_unique_token=params[:secretcode][:secret]
  if @secretcode.valid?
 @secretcode.save
 redirect_to secretcodes_path
  else
render 'new'
  end   end

before_save :guarantee_uuid!

private
def uuid
  if !uuid_field?
write_attribute :uuid_field, # UUID CODE HERE
  end
end

That is how I would personally do it, put it all in a method and
trigger it with before_save, this also gives you the option to
generate the UUID and modify/add it in other places too.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Default group

2012-10-17 Thread Jordon Bedwell
On Wed, Oct 17, 2012 at 8:59 AM, John Moser john.r.mo...@gmail.com wrote:
 I suggest all users should go into group 'users' as the default group,
 with $HOME default to 700 and in the group 'users'.  A umask of 027 or
 the traditional 022 is still viable:  the files in $HOME are not
 visible because you cannot list the contents of $HOME (not readable)
 or change into it to access the files within (not executable).  A user
 can grant permissions to other users to access his files simply by
 making the directory readable by them--by 'users' or others (thus
 everyone) or by fine-grained POSIX ACLs selecting for individual users
 and groups.

The problem with this is how are you going to fix permissions on bad
software like Ruby Gems who do not reset permissions when packaging
and uploading to the public repository (because they claim this would
violate security even though it comes from a public repo like the
Debian repo and having public read and execute on a public gem from a
public place is bad.) This has a huge impact as a default permission
for not just examples like Ruby gems but other software do not reset
when packaging, making it more cumbersome to package software and
making it so now work around's are the rule and not the exception.

-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss


Re: [Radiant] radiant install problem

2012-10-17 Thread Jordon Bedwell
On Wed, Oct 17, 2012 at 11:17 AM, Joel Oliveira joel.olive...@gmail.com wrote:
 Rubygems is down.  http://status.rubygems.org/

 Can't imagine it'll be down for long, but - that's the reason.

It's been down for an hour if not more, on the internet an hour is
almost a decade, that said, this happens weekly at RubyGems so get
used to it now, because they fluctuate like the oceans tides.


Re: [Rails] Bundle Install

2012-10-16 Thread Jordon Bedwell
On Tue, Oct 16, 2012 at 7:47 AM, Colin Law clan...@googlemail.com wrote:
 sudo apt-get install openssl libssl-dev

To add to what Colin said when I can't recognize a lib right off the
bat I do something like:

apt-cache search libssl |grep -- -dev
then pick the one that is right
apt-cache show libssl-dev will give you the version.

Though most of the time you will not have version issues with deep
system libs like that unless the library is mad outdated then
obviously you don't want it anyways.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] how to display the images in browser other than the storage path i.e.., public folder (ASAP)

2012-10-16 Thread Jordon Bedwell
On Tue, Oct 16, 2012 at 7:57 AM, Colin Law clan...@googlemail.com wrote:
 I don't use paperclip but my understanding that it is not normally
 possible to save outside of the public folder.

Add the path to your assets:
config.assets.paths.push(File.expand_path(~/my/path))

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Bundle Install

2012-10-16 Thread Jordon Bedwell
On Tue, Oct 16, 2012 at 8:45 AM, Avi aavinash.beh...@gmail.com wrote:
 Yes, rvm is working fine.
 version - 1.16.13
 I have added in .bashrc file also .
 But I don't know why I am getting this error.

What is the output of ldconfig -p? You should see something like:

ldconfig -p |grep libssl
libssl3.so (libc6) = /usr/lib/i386-linux-gnu/libssl3.so
libssl.so.1.0.0 (libc6) = /lib/i386-linux-gnu/libssl.so.1.0.0
libssl.so.0.9.8 (libc6) = /lib/i386-linux-gnu/libssl.so.0.9.8
libssl.so.0.9.8 (libc6) = /usr/lib/i386-linux-gnu/libssl.so.0.9.8
libssl.so (libc6) = /usr/lib/i386-linux-gnu/libssl.so

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Temperature display

2012-10-13 Thread Jordon Bedwell
On Sat, Oct 13, 2012 at 7:22 AM, Maddy ashokku...@shriramits.com wrote:
 Is the possible to display current weather temperature  ?

Everything is possible if you know how to do it, first would be to
find a weather API, Weather Channel is not so good (I don't even
remember if they have an API), Yahoo has a decent weather API and
Google did have one too, but they killed it.  There is also weather
underground.  I would prefer to go with Yahoo though personally.

That said, I don't know if any have been updated lately but they all
provide a good example, I would start with yahoo-weather Gem which
hasn't been updated for a couple of years but it gives you a good idea
of what's 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 this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Which one is best for debugging (Pry or Ruby Debug) ?

2012-10-12 Thread Jordon Bedwell
Hi,

On Fri, Oct 12, 2012 at 5:22 AM, Fahim Patel pafa...@gmail.com wrote:
 Let me know which one is best for debugging ?

Pry is a cross-over REPL (IMO) that replaces IRB and not Ruby
Debugger. I say it's cross-over because it supports some of what Ruby
Debugger does with addons and sometimes even built and also supports
all of what IRB does with some enhancements such as tab completion,
code spacing and syntax highlighting as well as supporting an easy way
to tap into an object with an REPL easily.  There are also other
things like the ability to show the source of a class, a method and
source around where you are (if you are in a method.)

 Is either Pry or Ruby Debug  ?

It's too much to compare Pry to Ruby Debugger because nothing can
replace Ruby Debugger in some cases but if you were throw Pry against
IRB for pure Ruby code it's going to be Pry all the way IMNSHO.

Nothing beats throwing binding.pry in the middle of everything and
figuring out what's going on from a live server, such as times when
something is going wrong in a model or controller or a decorator I
will throw a binding.pry in there and visit the page and follow the
tracks all the way down the line until I run into that line that is
causing the problem and then test what fixes it, write a test and fix
the code with the edit command and go on about my day.

 Also explain advantage of your selected gem  ?

That's something you have to figure out for yourself but I listed some above.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Rails 3.2 what are the best gems for full-text search in sql db ?

2012-10-12 Thread Jordon Bedwell
On Friday, 12 October 2012 09:12:45 UTC-5, Matt Jones wrote:

 Depending on what you're looking for, Sunspot may be useful - I've used it 
 for a number of projects that needed full-text seach + filtering etc. 
 There's a Railscast that should help you get started:

 http://railscasts.com/episodes/278-search-with-sunspot


I'm gonna definitely second this suggestion if you don't have PG.  I still 
somewhat like PG to save some money but I love working with solr when I 
have the chance and I would definitely choose it for a project with sunspot.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/c3s0O3DlVXUJ.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Which one is best for debugging (Pry or Ruby Debug) ?

2012-10-12 Thread Jordon Bedwell
On Friday, 12 October 2012 10:33:05 UTC-5, Fahim Patel wrote:

 As we use binding.pry , but we use same debugger in ruby debugger.
 And as per my knowledge debugger do same thing as binding.pry.If not than 
 explain ?  


They do.  But there is a distinction in that one's only goal is to debug, 
the other is a cross-over tool who is stuck between deciding on if it's a 
REPL or a debugger.  By nature it has debugging tools but by theory it's 
just a more advanced way to test concepts without needing to jump in and 
out of the terminal (unless you use VI or other) to test ideas.

Most at #pry will probably not deny that Pry is a Debugger just as they 
will most probably not deny that Pry is a REPL which makes it a tranny (I 
had to) cross-over tool.  I remember Banister working hard to bring more 
debugging tools into Pry but I haven't talked to him for a while so I don't 
know if that's still the case.

So to address your question, I prefer Pry 90% of the time, I test all my 
concept code in Pry before writing it so I can work out pieces of the idea 
and make sure they are as bug free as possible without full testing, I also 
use it to debug pieces of code.  So hopefully this explains what I mean.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/R5YtokUFLZEJ.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Which one is best for debugging (Pry or Ruby Debug) ?

2012-10-12 Thread Jordon Bedwell
On Friday, 12 October 2012 10:55:58 UTC-5, Fahim Patel wrote:

 1.   Pry is a REPL 
 2.   cross-over tool
 What this lines means.


1.) Read-eval-print loop, 2.) Stolen from car marketing (though I have no 
idea if it originates there), basically a cross-over was a mix between an 
SUV/Minivan and a car.  In this case Pry is the cross-over it's a mix 
between an REPL and debugger.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/-gckRVA45kgJ.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Re: Rails 3.2 what are the best gems for full-text search in sql db ?

2012-10-12 Thread Jordon Bedwell
On Fri, Oct 12, 2012 at 4:40 PM, Hassan Schroeder
hassan.schroe...@gmail.com wrote:
 What does that last sentence mean? Solr is FOSS.

It means what it means.  Obviously you think that Solr runs on Unicorn
farts and not on servers, that or you think that servers are free.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] what;s the right url in this case

2012-10-11 Thread Jordon Bedwell
On Thu, Oct 11, 2012 at 6:23 AM, roelof rwob...@hotmail.com wrote:
 Hello,

 I have this models

 class Berichten  ActiveRecord::Base
   attr_accessible :bericht, :user
   belongs_to :user
   belongs_to :Category
 end

 class User  ActiveRecord::Base
   attr_accessible :email, :name
   has_many :berichten
 end

 class Category  ActiveRecord::Base
   attr_accessible :id :name
   has_many :berichten
 end

 What I wonder is what the right url is when I want to place a new bericht
 into a specific category.
 Is it localhost:3000/categoryname/bericht/new ?

It depends on how you setup your resource and how you setup your
controller.  The model does not interact with the view and the view
should not interact with the model directly under any circumstance,
the controller hits up the model and then setups the view.

Since you only showed us your model's and not your controllers we have
no idea how you have it setup, though you can read more about routing
here: http://guides.rubyonrails.org/routing.html#crud-verbs-and-actions

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Rails 3.2 what are the best gems for full-text search in sql db ?

2012-10-11 Thread Jordon Bedwell
On Thu, Oct 11, 2012 at 12:44 PM, Erwin yves_duf...@mac.com wrote:
 there are a lot of solutions , some gems requiring a separate server
 setup...

 I need to search for occurrences of some 'text in multiple columns
 ( :name; :email, :description, ..)

https://github.com/Casecommons/pg_search
http://tenderlove.github.com/texticle/

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] validates_format_of :email throws error

2012-10-10 Thread Jordon Bedwell
On Wed, Oct 10, 2012 at 8:59 AM, jude judear...@gmail.com wrote:
 class Person  ActiveRecord::Base validates_format_of :email, :with =
 %r\A([^@\s]+)@((?:[-a-z0-9]+.)+[a-z]{2,})\Z/, :on = :create end

 validates :email, :format = { :with =
 %r\A([^@\s]+)@((?:[-a-z0-9]+.)+[a-z]{2,})\Z/, :on = :create }

%r\A([^@\s]+)@((?:[-a-z0-9]+.)+[a-z]{2,})\Z/
%r\A\Z/
%r/

Maybe use %r!! instead of %r/?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Unablt to send mails in my server

2012-10-09 Thread Jordon Bedwell
On Tue, Oct 9, 2012 at 3:17 AM, keerthi priya
emailtokeerthipr...@gmail.com wrote:
 hi all i am trying to setup mail option in my app. and when i am trying to
 send mails i got this error in my production log


 OpenSSL::SSL::SSLError (hostname was not match with the server certificate):
 __SNIP__
 my app runs on rails 2.3.5
 what is the problem what should i do to send my mails.

TLDR:
You: domain.com
Them: smtp.domain.com
Rails uses: domain.com
Rails says: domain.com does not match SSL certificate, actually
matches smtp.domain.com.
Solution: Use smtp.domain.com or setup your own smtp server with your
own SSL certificate.

It looks to me like you're using your domain name when your isp does
not have a certificate for your domain on their mail server, what I am
saying is that it's perfectly fine to use domain.com but your ISP
probably has smtp.provider.com and you should opt to use
smtp.provider.com instead of domain.com because it will cause mismatch
domain errors unless you setup your own server and get your own SSL
certificate (this is because most ISP's will not put your certificate
on their mail servers it's just too much trouble.)

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] cancan

2012-10-08 Thread Jordon Bedwell
On Mon, Oct 8, 2012 at 6:59 AM, Walter Lee Davis wa...@wdstudio.com wrote:
 By dealing with the model that represents current_user or its local 
 equivalent. The controller in question does not have to be the 
 UsersController by any means, as long as you have authenticated at some 
 point, and have a current_user somewhere in your application. Lots more here: 
 https://github.com/ryanb/cancan/wiki/Authorizing-Controller-Actions

You don't really need to authenticate since you can blanket deny based
on new user.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Re: Problems setting gmail mail

2012-10-08 Thread Jordon Bedwell
I'm no Windows fan but

On Mon, Oct 8, 2012 at 10:23 PM, Greg Donald gdon...@gmail.com wrote:
 Or use an OS that doesn't require participation in the Microsoft virus
 protection racket.

Because Mac's don't have Malware protection, oh wait, Apple just
doesn't tell you that they have internal Malware protection and you
obviously missed the memo on other operating systems getting Malware
too but it's fine, not all of us know how to read and not spew FUD.

 A firewall that runs any software except packet filtering isn't a
 firewall, it's a false sense of security.

Because Windows firewall doesn't support packet filtering... Because
you can't get another firewall?  I mean, it's so hard to find another
software Firewall that companies like ESET decided to no longer offer
them because... wel...l I mean you can't disable Windows firewall and
use theirs... Right?



Take your jokes somewhere else, you're not good at comedy.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Re: Problems setting gmail mail

2012-10-08 Thread Jordon Bedwell
On Mon, Oct 8, 2012 at 11:25 PM, Greg Donald gdon...@gmail.com wrote:
 I never said anything about a Mac, but since you brought it up.. is
 that what you Dreamweaver programmers use these days?

Yup, because clearly Dreamweaver is available on Linux in a native
form.  But a fail troll is fail, keep trying harder maybe one day
you'll get more clever in your trolls.

 Sorry dude.. you have me at a disadvantage.  I don't know much at all
 about Windows except that it has something like 98343203993 entries on
 Metasploit.  Seems more than enough reason to stay away.

So does Flash and Firefox (though I will not spew a random number that
makes it seem like it's the worst thing in the world,) but people
still use them, everything has an exploit sometime, the difference
between good and bad is fixing it or leaving it open.  I guess Linux
has never had an exploit, Mac has never had one, nobody but Windows
has ever had one.

 I wasn't trying to be funny. It's a choice to either participate in the virus 
 protection racket, or not.

You're right, it is a choice to choose to be a target or not. On that
subject, do you like to run into the middle of a gun range too and see
if you get hit with a bullet or not? If you don't then will you
automatically label all guns as inaccurate and therefore worthless at
doing their principle job?

 A firewall is a packet filter, that's it, nothing more.  If it's
 preventing something like Ruby from even starting up, it's no longer a
 firewall, it's something else.  So then call it something else.  I
 recommend thing that is using all my spare ram and cpu 'cause I'm too
 busy drinking the M$ koolaid to notice.

Nice joke.  Keep trying though.

 Again, not trying to be funny at all.

Still coming off as a guy who is trying to be the next big comedian.
Dully note this is my last reply, I'm not in this to steal this guys
thread and it's already bad enough I've replied twice, so I'm done
with replying so that I do not cluster a thread with more crap than I
already have.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: DNS caching disabled for 12.10...still

2012-10-07 Thread Jordon Bedwell
On Sun, Oct 7, 2012 at 10:47 PM, Daniel J Blueman dan...@quora.org wrote:
 Can you elaborate the specific reasons/mechanisms why without per-user
 caching, dnsmasq is still a security weakness? At least these views
 should be shared upstream so we can work on resolving the issues.

It's a subjective security issue IMO.  Pretty flawed in some cases, in
others it sounds like the guy who only pokes the bear while it's in
the cage and if the cage is nowhere to be found then it's game over,
won't even go near it.  What I am saying is for the average user it's
a case of why are you letting them on your PC at all if you do not
have a single ounce of trust and absolutely need per-user caching
because you fear they will attempt to poison you.  For other
environments it's another situation but those environments are the
rule apparently and not the exception... even though they are the
minority IMO.

-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss


Re: [Rails] Rails API Doc for Mail::Message?

2012-10-06 Thread Jordon Bedwell
That really depends on the library (gem) you used, the method you
store it as and most importantly where you stored it at.  Since it's
not a system account (I'm assuming) it's not going to store it in
system mail unless the gem is absolutely ignorant so you would have
had to of told it where and how to store it (the how is subjective
though because you could have stored it as another type of flat file,
mbox or maildir or even just kept it in memory long enough to parse it
into a db.)

Figure out where you stored it and go from there.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Rails with Phusion Passenger and Apache

2012-10-01 Thread Jordon Bedwell
On Mon, Oct 1, 2012 at 9:00 AM, Mandeep Kaur meghasi...@gmail.com wrote:
 On Sun, Sep 30, 2012 at 4:13 AM, Norbert Melzer timmel...@gmail.com wrote:
 Hint 7: Last but not least: Learn to use a deploy-tool like Capistrano
 or Vlad, it will make many things easier and do things automatically
 that I personally would forget with every deploy (see Hint 5 and 6 :)
 )

 Can I deploy app using Capistrano without Passenger?
 I have another question that using Passenger is correct option or not?

Yes, Capistrano can be setup to do whatever you want, including
provisioning servers, though personally I prefer to deploy to a
central server via Git then that server is designed to deploy, manage,
report, and test the code and then deploy it to all the other servers
and also provision extra servers if needed, via Juju.  Though that
solution is probably way out of the way of what most people would
want.  Way, out of the way of what most people want.

There is nothing wrong with using Passenger since it's the easiest
solution to work with, the only thing annoying about passenger is that
it takes over error pages and that is pretty annoying to somebody like
me who is happy to use passenger and even happy to mention that I use
it but do I want them controlling my errors? No, I don't know how to
turn it off and don't care to know.

That said, I use passenger on my dev machine because it's pure easy to
work with, I don't need to restart the server or manage anything more
than the apache server and issue a tmp/restart.txt if I need a hard
restart of the passenger server, on production I prefer to deploy with
Thin or Unicorn with Apache Event or Nginx.  Though lately I sway
towards Apache 2.4 w/ Event.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] gem file showing outdated gems?

2012-09-17 Thread Jordon Bedwell
On Mon, Sep 17, 2012 at 2:44 PM, wragen22 bradwr...@gmail.com wrote:
 For some reason my gem file in my rails app shows outdated versions of gems
 even though i've updated.

 Ie. gem 'uglifier', '= 1.0.3'

 However after running bundle update my terminal showed

 Using uglifier (1.3.0)

 Is there a dependency path that is incorrect? How can I make sure my gemfile
 is using the correct versions?

You update the version string in the Gemfile.  Just because you run a
bundle update does not mean that bundler will alter your Gemfile.
Actually that would be a violation of most principles if it did...that
is why it has it's own lock file so it does not violate reasonable
expectations from developers.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Array value to get except first two values

2012-09-15 Thread Jordon Bedwell
On Sat, Sep 15, 2012 at 9:33 AM, Hassan Schroeder
hassan.schroe...@gmail.com wrote:
 On Sat, Sep 15, 2012 at 3:21 AM, Maddy ashokku...@shriramits.com wrote:

 In an array value i need to find except first two values,

 example:
 [1,2,3,4,5,6,7,8 ]

 in that i need to get values except [1,2].

 How can i get it from this array??

 please advise

 Advisory #1: READ THE DOCS FOR ARRAY.

 Advisory #2:  [1,2,3,4,5,6,7,8].drop 2

Could you not just do [1, 2, 3, 4, 5, 6, 7, 8][2..-1]

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Passing Session id to rest client

2012-09-14 Thread Jordon Bedwell
On Fri, Sep 14, 2012 at 4:12 AM, Avi aavinash.beh...@gmail.com wrote:
 Hello,

 How can I pass session id through my rails application to a rest client
 through HTTParty or RestClient?

I would consider this a security problem, and a major one at that but
whatever who am I judge your bad security. You need to serialize the
object, I don't know about the default session handler but I think it
responds to load and dump and even if it doesn't you can always use
Marshal to Marshal the object but that means that the guy down the way
needs some of your code possibly to unmarshal it.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] (JOB) Looking for RoR Engineer

2012-09-14 Thread Jordon Bedwell
On Fri, Sep 14, 2012 at 12:43 PM, Dave Aronson
googlegroups2d...@davearonson.com wrote:
 On Fri, Sep 14, 2012 at 6:21 AM, Peter Hickman
 peterhickman...@googlemail.com wrote:

 And this is why people complain about job ad on this list!

 No location (I will not relocate to Greece for this job)

 That's the big one for me.  If they can't even put such extremely
 important basic information in their post, especially while they
 blather on and on about their so-called requirements, they have
 their priorities SO skewed, or chaotic, that I probably don't want to
 deal with them at all in the first place.

Most companies will state such a thing during the interview so why get
your knickers knotted?  The fact of the matter is what makes you such
a good candidate if you get so butt hurt over such a simple thing
instead of asking the simple question to the recruiter and then basing
your decision on that.  Ambition at all?

I would just as well give up on myself if I got my knickers knotted
over anything I could clarify by simply asking a question and didn't
even think or bother to ask that question... At that point, it just
means I lost the game because I'm not even able to do the simplest
things a programmer should do, like ask questions to get
clarification.

Jump down off the horse, join the real world.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Re: flash[:notice] not working

2012-09-10 Thread Jordon Bedwell
On Mon, Sep 10, 2012 at 5:34 AM, Manoj M. li...@ruby-forum.com wrote:
 Loganathan S. wrote in post #1075308:
 Paste your code...

 Sent from Samsung Mobile.

 Hi,
  here is my code below, @user is saved successfully but not flash
 doesnot works. I have wrote this in userscontroller




 if @user.save
   flash[:notice] = Your account has been created.
   redirect_to signup_url
 else
   flash[:notice] = There was a problem creating you.
   render :action = :new
 end

redirect_to signup_url, flash: {
  notice: Your account has been saved }

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Object Efficiency

2012-09-10 Thread Jordon Bedwell
On Mon, Sep 10, 2012 at 11:59 AM, Derek Lin derek...@hotmail.com wrote:
 Just want to know the best practices to make sure I get off on the right
 foot.  I think on a general rule, creating fewer instances of an object is
 ideal for performance right?  (I am not suffering any real problems yet)
 In Java, there is Inversion of Control/Dependency Injection.  I have read
 some blog saying that Rails's way is using Modules.  I have to look into
 more on Modules -- for example, are they equivalent to global functions?

People really need to use Modules more and classes less, for example
people often use a singleton class where they should be using a
Module... why should they be using a module? Because that class is
never going to initialized and it's not meant to be... IMO the only
time you use a singleton class is when you are mixing the way
ActiveRecord does when you inherit from it.

You wouldn't believe how many people I see /only/ use a Module when
they plan to inherit from it, and it's kind intriguing they do that
because the way I see it, Modules are (in simplistic terms) organized
groups of code that can run independently or be inherited from.  There
are of course technical differences that make Modules better than
Classes in some cases and Classes better than modules in some cases
but I'm not here to write a book for you.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] dash symbol

2012-09-08 Thread Jordon Bedwell
In ruby a minus on an array removes elements.   So its removing elements
from the array.
On Sep 8, 2012 1:42 PM, John Merlino stoici...@aol.com wrote:

 In the example below, what is the dash doing between the class
 attribute and array:

 (field_helpers -
 [:label, :check_box, :radio_button, :fields_for, :hidden_field,
 :file_field]).each
 do |selector|

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Rails Generate Devise::session controller

2012-09-04 Thread Jordon Bedwell
On Tue, Sep 4, 2012 at 2:12 AM, Ashokkumar Yuvarajan
ashokku...@shriramits.com wrote:
 Hi,

 I created session::controller as u said and also used routes like devise_for
 :users, :controllers = { :sessions = users/sessions }

 But i got an error

 Routing Error

 uninitialized constant Users

Because you don't have a User model.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Re: Write to tempfile

2012-09-04 Thread Jordon Bedwell
On Tuesday, 4 September 2012 06:27:52 UTC-5, Ruby-Forum.com User wrote:

 Yes,  I'm learning to program on my own...  I don't believe anyone would 
 pay for my work :-) 

 Thanks, you were right - it is writing to the file and I can see it 
 after closing. 
 Can I follow with one last question... 

 I have written a method, saved it in a table, and this is what I am 
 writing to the temp file. Can I require the file and then call the 
 method (getting the returned arguments)  from the temp file as it is 
 saved as a .rb file?  eg... 

 def format_q_gen 
   file = Tempfile.new([generator_file_name, .rb], 
 ./lib/generators) 
   file.write(question) 
   returned_question = generator_file_name  # Calls the method in the 
 tempfile 
   formatted = { 
 question: q[question_1], 
 correct_answer_letter: a 
  } 
   file.close 
   file.unlink 
 end 


I would personally write that method to be a little safer IMO.  Yeah it's 
true that you can sometimes guarantee that problems won't happen but 
relying on that slim chance is bad, it's better to let file closing 
operations fall onto an ensure so that if something does go wrong then you 
can at least guarantee you aren't sloppy about it.

def demo_tempfile
  file = Tempfile.new([hello_world, .rb], ./lib/generators)
  file.write($stdout.puts 'hello world')
  file.rewind
  $stdout.puts file.read # Will output the source without evaling.
  # raise # Uncomment this line to see what I mean about ensure.
ensure
  file.close!
end
 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/sXQZ1lknkrYJ.
For more options, visit https://groups.google.com/groups/opt_out.




Re: chromium no longer maintained

2012-09-04 Thread Jordon Bedwell
On Tue, Sep 4, 2012 at 12:58 AM, Benjamin Kerensa bkere...@ubuntu.com wrote:
 Daniel is talking about chromium-browser not Google Chrome which is closed
 source and he is correct chromium-browser is outdated since the maintainer
 of the package has moved on to other projects.

Please don't spread lies.  The bulk (most of) of Google Chrome is open
source, it's called, wait for it...Chromiumn.  The way you talk you
seem to think that Chrome started as a fork of Chromium that was
closed off when Chromium was a fork of Chrome that went open source,
which means that the truth is, the bulk (most of) of Chrome is open
source and you are spreading lies.

-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss


Re: chromium no longer maintained

2012-09-04 Thread Jordon Bedwell
On Tue, Sep 4, 2012 at 2:35 AM, Nicolas Michel
be.nicolas.mic...@gmail.com wrote:
 You have wrong. Chromium is and ever was the core of the web browser from
 Google. And it is open source (there was no before, no after, no fork - it
 is the core). Google Chrome is that core, plus a certain amout of code which
 is not open-source and so, you don't have access to the source code of
 Google Chrome itself (which is a packages chromium + other codes).

While I don't completely understand what you are saying I will attempt
to refute it. Please do research before stating somebody is wrong: In
September 2008, Google released a large portion of Chrome's source
code as an open source project called Chromium [2], which Chrome
releases are still based on. [1]

[1] http://en.wikipedia.org/wiki/Google_Chrome
[2] 
http://arstechnica.com/information-technology/2008/09/google-unveils-chrome-source-code-and-linux-port/

While today Chrome may be be based off of Chromium, originally
Chromium was based off of Chrome. Chrome is the original, Chromium is
the fork.  I am correct as I stated exactly that. So I repeat again,
stop spreading lies and use fact and truth please.  Thanks and have a
great day sir.

-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss


[Rails] Re: Adding functionality to an app in modular fashion?

2012-09-02 Thread Jordon Bedwell
On Sunday, 2 September 2012 18:43:23 UTC-5, jmcguckin wrote:

 Building a Rails app entails creating files in multiple locations. Config 
 dir, App, Views, Layouts, etc.

 If I have an existing application app framework, is there a way to add a 
 new feature (for example,  contracts management) where the files
 for the new feature are bundled together and not scattered willy-nilly 
 throughout the Rails application directory tree?


Build it as a Rails engine, so that it is its own application but can be 
included into your new applications.
http://edgeapi.rubyonrails.org/classes/Rails/Engine.html 
 


 Pros? Cons?


The pros and cons are only something you can come up with. 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/O-BvjDT5lLoJ.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Extracting information out of a database column

2012-08-31 Thread Jordon Bedwell


On Friday, 31 August 2012 01:42:10 UTC-5, Ruby-Forum.com User wrote:

 Hi All, 

 I'm new to rails and am trying to tackle a problem that I can't seem to 
 find the right solution for. 

 I have an existing database that im building a rails app on top of. One 
 of my columns 'message' is a long string that I would like to be able to 
 query and split into various attributes to then be able to display each 
 of those attributes in a view. 

 I'm trying to implement this into the controller, but don't seem to be 
 getting any where. 

 Can you please let me know how I can achieve this within rails? 



I don't quite understand exactly what you mean but it sounds to me like you 
want a custom serializer. 
http://stackoverflow.com/questions/4472479/custom-serialization-for-fields-in-rails
 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/6lDoxISEdbUJ.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Paginate an array

2012-08-31 Thread Jordon Bedwell


On Wednesday, 29 August 2012 08:07:18 UTC-5, Ruby-Forum.com User wrote:

 My controller code is as follows, 


   def index 
   end 

   def show 
 if params[:cat_id] 
 # cat_id is fetched from DB(a table with two columns id and name) 
 #mapped as cat_id in routes file 
   @articles = Article.find_all_by_name(params[:cat_id].gsub(/\-/, ' 
 ')) 
   render :action = :index 
 end 
   end 

 How to do pagination using will_paginate on this. 

 Here @articles is an array which fetches articles based on category 
 names. The output of this is as follows, 

 An index page with 3 category names and relevant articles under each 
 category. Now i need to apply will_paginate under each category in index 
 page. How to do this. Adding .paginate(:page = params[:page], 
 :per_page =3) returns undefined method 'total pages' since its an 
 array. Could you please advise me as to how pagination can be done. 
 Further, the url structure is article/categoryname/articlename (formed 
 using slug). 



Use where instead of the find_by helpers.

`Article.where(name = ?, params[:cat_id].gsub(/\-/, '')).paginate({
  :page = params[:page], :per_page =3 })`

find_all_by_* does it's job literally, it finds them all and it defeats the 
logic in it's name to add pagination to it.  So if you want pagination use 
where.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/nwdMDP2b1RUJ.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Question1 Cucumber Rails

2012-08-31 Thread Jordon Bedwell
On Fri, Aug 31, 2012 at 8:59 AM, Fahim Patel pafa...@gmail.com wrote:
 can we write multiple background in one feature file?

No.

 can we write multiple feature in one feature file.?

Yes.

Read: http://pragprog.com/book/hwcuc/the-cucumber-book

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Question1 Cucumber Rails

2012-08-31 Thread Jordon Bedwell
On Friday, 31 August 2012 08:59:48 UTC-5, Fahim Patel wrote:

 can we write multiple background in one feature file?


No.
 

 can we write multiple feature in one feature file.?


Yes.

Read: http://pragprog.com/book/hwcuc/the-cucumber-book 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/G6AxXF4dRUcJ.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: hii friends,,,,,i m new to rails......i think there is a problem in destroy command .

2012-08-31 Thread Jordon Bedwell
On Friday, 31 August 2012 09:03:40 UTC-5, Fahim Patel wrote:

 can one explain this issue?

 On Thursday, August 16, 2012 10:33:47 AM UTC+5:30, Fahim Patel wrote:

 let me explain this problem 
 ---rails destroythis command 
 destroy model,scaffold etc .
 problem is that if a model or other structure is exist than ,this command 
 will destroy all the related file to it...good ..till now no 
 problem...
 but problem is that if a model etc is not exist than till this command 
 remove the file ...it should not be done.there is no such a file name 
 exist..
 some error or exception should be execute at this time 

 i think this a problem???
 if not than expalin me..


It's not deleting anything.  Even though it claims it is it's just cruft in 
the terminal.  It's impossible to delete something that doesn't exist, well 
I should not say impossible as anything is possible but none-the-less the 
cruft is still outputted even if it does not delete anything.  Perhaps you 
should file a rails bug and ask them to adjust the message to imply 
trying instead of implying doing. 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/l8a8h9EFxqgJ.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] RedCarpet or alternative that can parse just *- and \s{4}

2012-08-30 Thread Jordon Bedwell
I was wondering if anybody had any idea if Redcarpet can be convinced 
easily to only parse code, paragraphs bold and italic or if there was an 
alternate gem that is just as fast that can be controlled to only allow 
selective parsing.  I've been reading the docs all night and cannot find 
any hint of easily filtering what Redcarpet will parse.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/kXUf-WuxBmYJ.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: how to change theme in rails 3.2.7

2012-08-30 Thread Jordon Bedwell
On Thursday, 30 August 2012 05:13:57 UTC-5, Ruby-Forum.com User wrote:

 I'm using rails 3.2.7. 

 I have few themes in my public/themes folder. 
 For example in my theme-1 folder 
 there is one index.html + style.css + few images (if required) 

 At the time of registration user will select one theme. Now when the 
 user will login that theme will display. I will use handle 
 bar(http://handlebarsjs.com/) for data insertion. 

 My main problem is that how I'll load the theme from public/themes 
 folder to the user after login. 

 My controller is below after user login 

 class ClientUsersController  ApplicationController 

 def index 

 end 

 end 


 Right now when user login he will redirect to index method and 
 index.html.erb data display to him with application.html.erb layout. 

 So how I will display the theme instead of application layout. 



Store all the CSS files and image files in hierarchical (except for the 
stylesheets) order inside of the assets folders and then store their 
preference in the session and use `stylesheet_link_tag(session[:theme] || 
:default)` but you might add in an extra check to make sure the theme 
exists first I guess to prevent simple tampering. 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/8cefqb7DF2UJ.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: how to change theme in rails 3.2.7

2012-08-30 Thread Jordon Bedwell


On Thursday, 30 August 2012 05:26:14 UTC-5, Ruby-Forum.com User wrote:

 Jordon Bedwell wrote in post #1073894: 
  On Thursday, 30 August 2012 05:13:57 UTC-5, Ruby-Forum.com User wrote: 
  
  
  end 
  
  
  Right now when user login he will redirect to index method and 
  index.html.erb data display to him with application.html.erb layout. 
  
  So how I will display the theme instead of application layout. 
  
  
  
  Store all the CSS files and image files in hierarchical (except for the 
  stylesheets) order inside of the assets folders and then store their 
  preference in the session and use `stylesheet_link_tag(session[:theme] 
  || 
  :default)` but you might add in an extra check to make sure the theme 
  exists first I guess to prevent simple tampering. 


 Thx Jordon 

 But where should I keep my theme1/index.html file 


Depending on what it has in it, what I would do is turn it into a template 
in the folder of the controller and just add a manual render at the bottom 
of the controller that triggers based on the theme.  So if your controller 
is UserController and the theme is theme1 then I would make 
theme1/index.html into app/views/user/theme1.erb and then do render :theme1 
in the controllers action.  Though at the point I don't know what you would 
need mustache/handlebar for unless it's entirely Ajax. 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/GuJq_qsx2bwJ.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Is it a good idea for me to learn Ruby on Rails?

2012-08-30 Thread Jordon Bedwell
On Thursday, 30 August 2012 07:41:13 UTC-5, Dheeraj Kumar wrote:

 Make sure whatever you learn finally, use MongoDB with it. It is web scale.


Because added complexity on already complex apps means more performance.
Because using a pure Ruby wrapper is faster than C.
Because you can't cluster PG anymore.
Because you can't replicate anymore.
Because you can't do connection pooling.
Because you can't shard traditional databases anymore.
Because faster is always better, especially when it costs.

Why take something that specific and apply it to everything? Why? Why?



-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/qGtZUxY6UOgJ.
For more options, visit https://groups.google.com/groups/opt_out.




[Desktop-packages] [Bug 1016724] Re: Laptop brightness always reverts to maximum on 12.04

2012-08-26 Thread Jordon Bedwell
I don't know if this is related or not but this might not be a GNOME
bug, this might actually be a Kernel bug with HP's as on my system the
Kernel reports that it is unable to obtain the brightness with the
message [Firmware Bug]: ACPI: No _BQC method, cannot determine initial
brightness

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to gnome-settings-daemon in Ubuntu.
https://bugs.launchpad.net/bugs/1016724

Title:
  Laptop brightness always reverts to maximum on 12.04

Status in “gnome-settings-daemon” package in Ubuntu:
  Confirmed

Bug description:
  Whenever I start my laptop the brightness is at maximum. If I turn it
  down (I set it to minimum) it returns to maximum if I change user
  account. To be clear, it will still be maximum if I then switch back
  to the original user account. Very occasionally it has also reset to
  maximum when I switch workspace, but I can't recreate this behaviour
  consistently so I'm wary of saying it's the same problem.

  My expected behaviour is that the brightness level should stay where I
  set it, as it did in previous releases. Output of lsb_release -rd,
  lshw and lspci are below, in that order.

  lsb_release -rd
  Description:  Ubuntu 12.04 LTS
  Release:  12.04

  lshw
  lappy
  description: Portable Computer
  product: Inspiron 1545 ()
  vendor: Winbond Electronics
  serial: F09PXJ1
  width: 64 bits
  capabilities: smbios-2.4 dmi-2.4 vsyscall32
  configuration: boot=normal chassis=portable 
uuid=44454C4C-3000-1039-8050-C6C04F584A31
*-core
 description: Motherboard
 product: 0G437N
 vendor: Winbond Electronics
 physical id: 0
 serial: .F09PXJ1.CN7016699C008K.
   *-firmware
description: BIOS
vendor: Winbond Electronics
physical id: 0
version: A10
date: 07/17/2009
size: 64KiB
capacity: 15MiB
capabilities: isa pci pcmcia pnp upgrade shadowing cdboot 
bootselect int13floppy720 int5printscreen int9keyboard int14serial int17printer 
int10video acpi usb agp smartbattery biosbootspecification netboot
   *-cpu
description: CPU
product: Intel(R) Core(TM)2 Duo CPU T6500  @ 2.10GHz
vendor: Intel Corp.
physical id: 400
bus info: cpu@0
slot: Microprocessor
size: 1200MHz
capacity: 2100MHz
width: 64 bits
clock: 200MHz
capabilities: x86-64 fpu fpu_exception wp vme de pse tsc msr pae 
mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 
ss ht tm pbe syscall nx constant_tsc arch_perfmon pebs bts rep_good nopl 
aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave 
lahf_lm cpufreq
configuration: cores=2 enabledcores=2 threads=2
  *-cache:0
   description: L1 cache
   physical id: 700
   size: 128KiB
   capacity: 128KiB
   capabilities: internal write-back data
  *-cache:1
   description: L2 cache
   physical id: 701
   size: 2MiB
   capacity: 2MiB
   clock: 66MHz (15.0ns)
   capabilities: pipeline-burst internal varies unified
   *-memory
description: System Memory
physical id: 1000
slot: System board or motherboard
size: 4GiB
  *-bank:0
   description: DIMM DDR Synchronous 800 MHz (1.2 ns)
   product: HYMP125S64CP8-S6
   vendor: Hynix Semiconductor (Hyundai Electronics)
   physical id: 0
   serial: 4261365D
   slot: DIMM_A
   size: 2GiB
   width: 64 bits
   clock: 800MHz (1.2ns)
  *-bank:1
   description: DIMM DDR Synchronous 800 MHz (1.2 ns)
   product: HYMP125S64CP8-S6
   vendor: Hynix Semiconductor (Hyundai Electronics)
   physical id: 1
   serial: 4221396E
   slot: DIMM_B
   size: 2GiB
   width: 64 bits
   clock: 800MHz (1.2ns)
   *-pci
description: Host bridge
product: Mobile 4 Series Chipset Memory Controller Hub
vendor: Intel Corporation
physical id: 100
bus info: pci@:00:00.0
version: 07
width: 32 bits
clock: 33MHz
  *-pci:0
   description: PCI bridge
   product: Mobile 4 Series Chipset PCI Express Graphics Port
   vendor: Intel Corporation
   physical id: 1
   bus info: pci@:00:01.0
   version: 07
   width: 32 bits
   clock: 33MHz
   capabilities: pci pm msi pciexpress normal_decode bus_master 

[Bug 1016724] Re: Laptop brightness always reverts to maximum on 12.04

2012-08-26 Thread Jordon Bedwell
I don't know if this is related or not but this might not be a GNOME
bug, this might actually be a Kernel bug with HP's as on my system the
Kernel reports that it is unable to obtain the brightness with the
message [Firmware Bug]: ACPI: No _BQC method, cannot determine initial
brightness

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gnome-settings-daemon in Ubuntu.
https://bugs.launchpad.net/bugs/1016724

Title:
  Laptop brightness always reverts to maximum on 12.04

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/1016724/+subscriptions

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs


[Bug 1016724] Re: Laptop brightness always reverts to maximum on 12.04

2012-08-26 Thread Jordon Bedwell
I don't know if this is related or not but this might not be a GNOME
bug, this might actually be a Kernel bug with HP's as on my system the
Kernel reports that it is unable to obtain the brightness with the
message [Firmware Bug]: ACPI: No _BQC method, cannot determine initial
brightness

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1016724

Title:
  Laptop brightness always reverts to maximum on 12.04

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/1016724/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Rails] Re: Rails test environment can't find capybara methods

2012-08-25 Thread Jordon Bedwell
On Friday, 24 August 2012 09:33:10 UTC-5, Ruby-Forum.com User wrote:

 I'm trying to include capybara into my RSpec integration tests. It seems 
 to work fine with the Cucumber environment but for some reason it's 
 giving me issues with the Test environment. Here are the steps I've 
 followed: 

 1. Include capybara in the test group of my Gemfile 
 2. Included require 'capybara/rails' in my spec_helper.rb 
 3. Included config.gem 'capybara', :lib = false in my 
 config/environments/test.tb 

 It doesn't complain about not being able to find Capybara, yet it still 
 fails my test and gives me an 'undefined method visit for 
 #Spec::Rails. which is the first Capybara specific method in my 
 test. Any other ideas I could try? Thanks ahead of time! 


This is related to a bug I reported not too long ago 
https://github.com/mattheworiordan/capybara-screenshot/issues/24 there is a 
way you can fix it before they figure out a way to handle the situation 
elegantly. 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/zgR6Wru_w_QJ.
For more options, visit https://groups.google.com/groups/opt_out.




<    1   2   3   4   5   6   7   8   >