[Rails] Re: How to use an ActiveRecord plugin in a non-Rails project

2011-05-29 Thread Josh Cheek
On Sat, May 28, 2011 at 7:32 AM, Josh Cheek wrote: > > I was thinking I could probably fork it, give it a gemspec, and then tell > Bundler to look at my forked repo, does that sound reasonable? > > I ended up doing this. https://github.com/JoshCheek/acts_as_list Add one fairly s

[Rails] How to use an ActiveRecord plugin in a non-Rails project

2011-05-28 Thread Josh Cheek
I'm using ActiveRecord on a Sinatra app. I need one of my tables to be sorted, so I'm using acts_as_list (https://github.com/swanandp/acts_as_list). However, it isn't a gem, so I don't know how to get it to work with Bundler. Currently, I just cloned the source into a dir named "vendor". This work

Re: [Rails] Re: gsub help

2010-06-09 Thread Josh Cheek
On Wed, Jun 9, 2010 at 9:42 AM, anon_comp wrote: > On Jun 9, 9:37 am, anon_comp wrote: > > Here's my code > > > > def index > > file = "BLAH-ex201588.doc" > > @file_cut = order.gsub(/[\w [- ! # $ % ^ & * = +]+]+\.doc$/, > > '*.doc) > > end > > > > The code worked before when I was using

Re: [Rails] Re: reset restful authentication user password from rails console

2010-05-28 Thread Josh Cheek
On Fri, May 28, 2010 at 9:49 AM, andrew v wrote: > > > On Fri, May 28, 2010 at 6:07 PM, Frederick Cheung < > frederick.che...@gmail.com> wrote: > >> >> >> On May 28, 12:11 pm, andrew v wrote: >> > Hi, >> > >> > I have implemented restful authentication plugin in my rails >> application. >> > It'

Re: [Rails] Re: Site Navigation With Polymorphic Has Many Through

2010-05-26 Thread Josh Cheek
> pretty intuitive and efficient: > > > http://wiki.github.com/collectiveidea/awesome_nested_set/awesome-nested-set-cheat-sheet > > > Tilde Equals > > > On May 25, 12:29 pm, Josh Cheek wrote: > > Hi, seem to keep running into a wall here. I can't find an

[Rails] Site Navigation With Polymorphic Has Many Through

2010-05-25 Thread Josh Cheek
Hi, seem to keep running into a wall here. I can't find any resources on site navigation that can deal with any model being in the nav, allow nesting, and can dynamically update. So I thought about it for a while, and decided on a MenuItems class, which contained the position of the child in relat

Re: [Rails] Ruby Midwest Early Bird Ends Tomorrow

2010-05-14 Thread Josh Cheek
On Fri, May 14, 2010 at 4:50 PM, Luke Pillow wrote: > The Ruby Midwest Conference Early Bird pricing ends tomorrow, Saturday, May > 15. Don't miss out on two full days of great talks, networking, and hacking > for only $75! > > Attendees are also invited to the OMGWTFBBQ (http://bbq.rubymidwest.

Re: [Rails] multiple foreign keys

2010-04-05 Thread Josh Cheek
On Mon, Apr 5, 2010 at 3:15 AM, Colin Law wrote: > It would be less effort for us to work out what you are trying to do > if you gave us the model relationships (belongs_to etc). Also if you > show the sql that works it would allow us to see what you mean. > > Colin > Basically I want to say

[Rails] Re: multiple foreign keys

2010-04-05 Thread Josh Cheek
Also having difficulty getting the has_many to work with this. I thought about a separate join table for it,and even got it working with has_and_belongs_to_many :beat , :class_name => 'Player' , :foreign_key => 'winner_id' , :association_foreign_key => 'loser_id' , :join_table => 'games' , :condi

[Rails] multiple foreign keys

2010-04-05 Thread Josh Cheek
Hi, I have two players playing a game. The game has foreign keys into each player: player1_id, player2_id >From the Player model, I can get the opponent self played if I know which player self was, but I want to agnostically pull everyone that self has played against, regardless of whether self wa

[Rails] Presentation Ideas

2010-03-22 Thread Josh Cheek
Hi, I'm going to give a talk on Rails to my campus ACM group in about two weeks. I'm trying to think of ideas. The 15 minute blog is great, and I'd kind of like to do something like that, but I can't do better than DHH or Ryan have, and if they look into it more, they'll come across that pretty qui

Re: [Rails] Some logic problem

2010-03-18 Thread Josh Cheek
On Fri, Mar 19, 2010 at 12:03 AM, Hemant Bhargava wrote: > Hello champs, > > I am in dilemma here. I have structure like this:- > > EmployeeA > | > EmployeeBEmployeeC EmployeeD >

Re: [Rails] How to make an array available to all views.

2010-03-12 Thread Josh Cheek
On Fri, Mar 12, 2010 at 2:59 AM, Andy Jeffries wrote: > > It's dirty, horrible, bad form, breaks the separation of layers... I don't know what you mean by dirty, it saves several lines of code and when looking at the view code it is easier to see what is happening than to see a

Re: [Rails] How to make an array available to all views.

2010-03-10 Thread Josh Cheek
On Wed, Mar 10, 2010 at 11:48 AM, Robert Walker wrote: > 1. What about methods on models that change themselves in some way? > > <%= @post.last_viewed_at %> > > Suppose the last_viewed_at method returned a previously stored time, > then updated the model to store a new current time. Maybe a bad ex

Re: [Rails] Re: Fixnum problem

2010-03-07 Thread Josh Cheek
On Sun, Mar 7, 2010 at 1:15 PM, Manish Belsare wrote: > Sir i have now tried to declare a same method twice with a different > name but the same parameter to both the methods.. > Bt i still get that fixnum problem.. > i want to know that calling two different name methods in on Model file > works

Re: [Rails] Fixnum problem

2010-03-07 Thread Josh Cheek
On Sun, Mar 7, 2010 at 12:04 PM, Manish Belsare wrote: > Sir can i know what is the meaning of the phrase 'comparison of Fixnum > with nil failed' > > I want to pass two parameters to a method in a model file.. > bt wen i pass an integer then it gives the above error.. > Please help..

Re: [Rails] Current state of Rails CMSs

2010-03-03 Thread Josh Cheek
On Wed, Mar 3, 2010 at 11:05 AM, Devin McCabe wrote: > I've been using Rails for many years, but it's been primarily for > building custom applications and hosting small sites with less than ten > pages. I'm interested in learning a CMS to start building more > content-heavy sites. > > The last

Re: [Rails] Re: Tweetstream

2010-03-01 Thread Josh Cheek
On Mon, Mar 1, 2010 at 6:43 PM, Ritchie wrote: > Hi Josh, > > If your overall goal is to run it as a background task on Heroku, I > think you want this: http://docs.heroku.com/background-jobs. > > I don't think that there's any other way to run background jobs on > Heroku. > > Regards > Ritchie

[Rails] Re: Tweetstream

2010-03-01 Thread Josh Cheek
Based on their example, I got this to work: -- start code -- require 'rubygems' require 'tweetstream' require 'ruby-growl' username = 'blinkdev' password = **secret** tracks= ['#ROCKPIC'] puts "Starting a GrowlTweet to track: #{tracks.inspect}" TweetStream::Daemon.new(userna

[Rails] Tweetstream

2010-03-01 Thread Josh Cheek
Hi, I want to use the TweetStream gem http://github.com/intridea/tweetstreamin my Rails app I can't seem to figure out how to do it, because it opens a connection and then won't move on. I got it to work in a Ruby script with -- start code -- require 'rubygems' require 'tweetstre

Re: [Rails] make website based on ruby o.o

2010-02-22 Thread Josh Cheek
On Sun, Feb 21, 2010 at 11:33 AM, Law Jer Cherng wrote: > hi guys. It's not my first time on ruby, i mean, well I did get to > page 40 of my 300 page guide book, but that's not the point =S. thing > is, I don't really know what you gotta do to make a blog out of ruby. > I've heard RoR but it's re