[Rails] weird capistrano error: caching old hostnames?

2011-12-26 Thread Mike C
I'm trying to move my app to a new server, and in the deploy.rb file I updated the hostname to reflect the new server. However, when I run any cap task it still contacts the old server no matter what, and I can't figure out why this is. There is no reference to the old server anywhere I can see.

[Rails] Re: Rackspace, Engine Yard, Heroku, etc. - Which do you recommend?

2011-08-15 Thread Mike C.
There is a little company called Webappcabaret.com that specializes in PAAS. You may give them a try. They use the same cloud infrastructure as the others you mentioned, but I think their PAAS platform is far superior. Ben Knight wrote in post #1016745: Hello. We are looking for a new

[Rails] exception notifier not working on production

2011-04-26 Thread Mike C
I'm using Rails 3 and installed exception notifier as a gem. It works perfectly in development, but for some reason it isn't sending e-mails in production. When I check the logs, I don't see any mention of my app trying to send an e-mail, but running rake middleware shows that it is loaded. I'm

[Rails] Re: exception notifier not working on production

2011-04-26 Thread Mike C
I'm using Gmail for both my development and production though, I configured them to be the same actually (even the same account). On Apr 26, 6:08 am, Bryan Crossland bacrossl...@gmail.com wrote: Sent from my iPhone On Apr 26, 2011, at 3:56 AM, Mike C snib...@gmail.com wrote: I'm using Rails

[Rails] Re: mysql key too long error

2011-04-25 Thread Mike C
Nevermind, I got it. I just have to test to see if it works. Thanks for your help! On Apr 24, 3:49 pm, Mike C snib...@gmail.com wrote: Oh, I was looking for an example of how to use it like a piece of code or something. On Apr 24, 7:51 am, Frederick Cheung frederick.che...@gmail.com wrote

[Rails] Re: mysql key too long error

2011-04-24 Thread Mike C
How can I use the :limit to change taggable_ type and context? On Apr 24, 12:32 am, Frederick Cheung frederick.che...@gmail.com wrote: On Apr 23, 11:23 pm, Mike C snib...@gmail.com wrote: I'm using the acts as taggable on plugin, and in the migrations there's a line of code to create

[Rails] Re: mysql key too long error

2011-04-24 Thread Mike C
Oh, I was looking for an example of how to use it like a piece of code or something. On Apr 24, 7:51 am, Frederick Cheung frederick.che...@gmail.com wrote: On Apr 24, 9:23 am, Mike C snib...@gmail.com wrote: How can I use the :limit to change taggable_ type and context? The limit tells

[Rails] mysql key too long error

2011-04-23 Thread Mike C
I'm using the acts as taggable on plugin, and in the migrations there's a line of code to create an index: add_index :taggings, [:taggable_id, :taggable_type, :context], :name = tagging_index, :limit = {:name = 10, :surname = 20} When I use unicode, the migration fails and I get told that the

[Rails] rvm + capistrano + gitosis

2011-04-22 Thread Mike C
I don't know how people do it, but I'm having huge headaches getting these things to work with each other. At the moment, doing a cap deploy:setup gives me this error: /Users/mikool/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/ capistrano-2.5.19/lib/capistrano/recipes/deploy.rb:55:in `join': can't

[Rails] Re: starting thinking sphinx on server reboot

2011-02-06 Thread Mike C
I know that, but I want it to start automatically whenever the server restarts so I dont have to run that command myself. I want this automated. On Feb 6, 12:11 am, loganathan sellappa loganathan...@gmail.com wrote: you can start ts by rake ts:start -- You received this message because you are

[Rails] starting thinking sphinx on server reboot

2011-02-05 Thread Mike C
I wanna know how I can start my thinking_sphinx and its delayed delta when I reboot my server. Currently if I reboot my server, I have to use cap to start those things and it's a little bit of an annoyance so I'd like to automate this somehow. Anyone know how? -- You received this message

[Rails] flash message shown after ajax request

2011-01-19 Thread Mike C
As the title says, when people aren't using ajax I use flash messages to tell them stuff. However, when they use the ajax stuff the flash message shows when they move to a different page. I've searched in this group and have found similar cases, but they all use RJS and can just call Flash.discard

[Rails] Re: a few best practices questions

2011-01-19 Thread Mike C
 pm, Mike C snib...@gmail.com wrote: Thanks for the advice, I didn't know about cancan, it looks like it'll make things a lot easier for me. As for the resources, that's the case except when I want to create a new resource. The to-be child doesn't have a parent yet since it doesn't exist

[Rails] Re: respond_with javascript

2011-01-18 Thread Mike C
the .js.erb files. As far as I know, I'm using the most recent version of jQuery and the most recent version of the rails driver for it. On Jan 14, 8:47 pm, Mike C snib...@gmail.com wrote: My ajax stopped working when I switched to using respond_with. For my Votes, I have the create action

[Rails] Re: respond_with javascript

2011-01-18 Thread Mike C
I found a solution here: https://github.com/rails/jquery-ujs/issues/issue/52 On Jan 18, 12:07 pm, Mike C snib...@gmail.com wrote: I forgot to mention that I'm using jQuery. I tried ajax using prototype in a test app and it worked, but when I use jQuery it doesn't work. However, when using

[Rails] rails trying to load prototype in production

2011-01-14 Thread Mike C
I'm using jQuery and I have this line in my Application.rb: config.action_view.javascript_expansions[:defaults] = %w(jquery rails application) Everything works fine in development, but in production I notice that Rails is trying to load all the prototype files and there's nothing in the

[Rails] respond_with javascript

2011-01-14 Thread Mike C
My ajax stopped working when I switched to using respond_with. For my Votes, I have the create action and the corresponding create.js.erb, and respond_to :html, :js, :xml in the controller. Heres the log when I try and create a vote: Started POST /stories/3-asdfasdf/votes for 127.0.0.1 at

[Rails] Re: permissions and authorization

2011-01-13 Thread Mike C
with authorization. Your matrix isn't all that complicated as a model of permissions :-) -- Top-posted from an HTC On Jan 13, 2011 7:40 AM, Mike C snib...@gmail.com wrote: In my app I have 3 different models in a linear fashion: M1, M2, and M3. M1 has many M2 which has many M3. M1 has 2

[Rails] permissions and authorization

2011-01-12 Thread Mike C
In my app I have 3 different models in a linear fashion: M1, M2, and M3. M1 has many M2 which has many M3. M1 has 2 properties: private and completed. If it's private then only the person who created M1 can do anything with it (all the rest actions), and if it's completed then more M2 and M3

[Rails] deploying with capistrano and bundler

2011-01-10 Thread Mike C
I'm deploying via capistrano but when I try and do a bundle install it asks for my password to install the gems. I give it a password but oddly enough the password appears on the console in plain text and when I press enter, nothing happens. I waited for a couple hours and still nothing happened,

[Rails] a few best practices questions

2011-01-03 Thread Mike C
My app currently is working but I'm a little OCD about conforming to best practices so I'd like to get a few things cleared up. 1. I have quite a lot of before_filters to restrict certain parts of the site to some users, and a lot of my controllers use very similar authorization code. Here's an

[Rails] Re: a few best practices questions

2011-01-03 Thread Mike C
Thanks for the advice, I didn't know about cancan, it looks like it'll make things a lot easier for me. As for the resources, that's the case except when I want to create a new resource. The to-be child doesn't have a parent yet since it doesn't exist at the moment so I'd have to pass the parent

[Rails] ajax not working in rails 3

2011-01-01 Thread Mike C
I followed tutorials and changed my Rails app to use jQuery. All the needed files are in place, but ajax isn't working. I have the format.js in the correct place and the js.erb file named after the action. Calling stuff from application.js works, and I do have remote = true in the link. When I try

[Rails] capistrano, gitosis and remote cache

2010-12-31 Thread Mike C
I'm about ready to deploy my app so I decided to create a testapp to deploy just so I can learn how to use capistrano for deployment. I'm running Ruby 1.8.7 with Rails 3.0.3, capistrano 2.5.19 and git 1.7.3.2 with gitosis. Everything is going to be hosted on the same machine (git and the app, so

[Rails] Re: capistrano, gitosis and remote cache

2010-12-31 Thread Mike C
, 10:58 pm, Mike C snib...@gmail.com wrote: I'm about ready to deploy my app so I decided to create a testapp to deploy just so I can learn how to use capistrano for deployment. I'm running Ruby 1.8.7 with Rails 3.0.3, capistrano 2.5.19 and git 1.7.3.2 with gitosis. Everything is going to be hosted

[Rails] how to use the new mailer inside a model

2010-12-29 Thread Mike C
I want to call the mailer from inside my model, but it gives me this error: uninitialized constant User::PasswordResetMailer So I'm assuming that I have to include it somehow, but I'm not sure how to do this. I've tried searching Google but I'm not getting any helpful results. -- You received

[Rails] Re: rails 3 routes

2010-12-21 Thread Mike C
After a few days of experimenting I think I got it fixed. All I did was make the search variable optional, and removing it also does the trick. On Dec 20, 10:58 pm, daze dmonopol...@gmail.com wrote: On Dec 20, 9:13 pm, Marnen Laibow-Koser li...@ruby-forum.com wrote: Well, you didn't quote the

[Rails] rails 3 cleaning sub menu html

2010-12-21 Thread Mike C
I have some code to allow pages to define sub menus within their respective html files. Here's the method I have in the application helper: def sub_menu(block) links ||= [] links capture(block) @sub_menu ||= links.each do |link| @sub_menu += content_tag(:li, link)

[Rails] Re: rails 3 cleaning sub menu html

2010-12-21 Thread Mike C
to call .html_safe on the return value of your helper.  In Rails 3, everything is automatically scrubbed. On Dec 21, 12:50 pm, Mike C snib...@gmail.com wrote: I have some code to allow pages to define sub menus within their respective html files. Here's the method I have in the application

[Rails] rails 3 routes

2010-12-19 Thread Mike C
I'm a little confused about custom routes in rails 3. I have a variable that I had a default value for in rails 2, and changing it to rails 3 version gives this: match 'stories/list/:story_list/:search' = 'stories#index', :as = 'story_list', :story_list = 'popular', :search = nil When I use the

[Rails] Re: `require': no such file to load -- activerecord

2010-12-11 Thread Mike C
Thanks for the response! I don't manually include active record anywhere, so how can I fix this? On Dec 11, 10:57 am, Jeffrey L. Taylor r...@abluz.dyndns.org wrote: Quoting Mike C snib...@gmail.com: I'm trying to upgrade my Rails 2.3.5 app to Rails 3, and when I try and start the rails

[Rails] `require': no such file to load -- activerecord

2010-12-10 Thread Mike C
I'm trying to upgrade my Rails 2.3.5 app to Rails 3, and when I try and start the rails server with 'rails s' I get this: /Library/Ruby/Gems/1.8/gems/activesupport-3.0.3/lib/active_support/ dependencies.rb:239:in `require': no such file to load -- activerecord (LoadError) Using Mac OS X Snow

[Rails] Re: converting a tiff image

2010-02-25 Thread Mike C
... Cheers, Walter On Wed, Feb 24, 2010 at 12:24 PM, Peter De Berdt peter.de.be...@pandora.be wrote: On 23 Feb 2010, at 23:19, Mike C wrote: Thanks. How can I use paperclip to convert? I tried looking it up in google but got no results. On Feb 23, 1:59 pm, Robert Walker li...@ruby

[Rails] converting a tiff image

2010-02-23 Thread Mike C
Does anyone know of a way to convert an uploaded tiff image into a jpg or png? -- 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-t...@googlegroups.com. To unsubscribe from this group, send

[Rails] Re: converting a tiff image

2010-02-23 Thread Mike C
Thanks. How can I use paperclip to convert? I tried looking it up in google but got no results. On Feb 23, 1:59 pm, Robert Walker li...@ruby-forum.com wrote: Mike Chai wrote: Does anyone know of a way to convert an uploaded tiff image into a jpg or png?

[Rails] creating 2 things at the same time?

2009-10-04 Thread Mike C
So I have 2 models, Comment and Picture. A Comment has one Picture if the users so chooses, but when someone is creating a Comment, it would of course call the create method in the Comment Controller. However, I want it to create a Picture as well. I could add it to the create method in the

[Rails] circular relationship - habtm

2009-10-03 Thread Mike C
So I have 2 models: Picture and Comment. Pictures have many Comments, but I'd like for users to be able to post Pictures in Comments, so Comments will have one Picture (possibly). This creates a kind of circular relationship it looks like, and the only way I could think of to implement this is

[Rails] best way to search - alternatives to full text (thinking sphinx)?

2009-09-13 Thread Mike C
Currently I am using thinking_sphinx, but to my dismay, a lot of hosts do not have sphinx installed and are unwilling to install it because of security reasons. This leaves me with a very limited option of hosting as I'd have to get a VPS/dedicated but I just don't have that kind of money, so

[Rails] getting mysql gem to work with WAMP's MySQL

2009-07-20 Thread Mike C
I use WAMP and I don't really want to install another MySQL just to work with Rails. How can I make the mysql gem use WAMP's MySQL? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post

[Rails] Re: getting mysql gem to work with WAMP's MySQL

2009-07-20 Thread Mike C
Thanks. It's just that when I tried to require 'mysql' in the irb, it gave me an error telling me the libmysql.dll or something couldn't be found and that I'd need to reinstall/repair mysql. On Jul 20, 3:41 pm, Frederick Cheung frederick.che...@gmail.com wrote: On Jul 20, 9:32 pm, Mike C snib

[Rails] Re: getting mysql gem to work with WAMP's MySQL

2009-07-20 Thread Mike C
I just tried to use MySQL and it didn't work. I even installed a new one and it still doesn't work. Any ideas? On Jul 20, 4:52 pm, Mike C snib...@gmail.com wrote: Thanks. It's just that when I tried to require 'mysql' in the irb, it gave me an error telling me the libmysql.dll or something

[Rails] Re: getting mysql gem to work with WAMP's MySQL

2009-07-20 Thread Mike C
This was fixed by copying the libmysql.dll located in the mysql installation location to the Ruby/bin directory. :) On Jul 20, 7:33 pm, bill walton bwalton...@gmail.com wrote: Hi Mike, On Mon, 2009-07-20 at 18:31 -0700, Mike C wrote: I just tried to use MySQL and it didn't work. I even

[Rails] Rails vs PHP in resource usage

2009-07-19 Thread Mike C
I'd like to know if Rails requires significantly more resources than PHP. Assume the following setups: Rails: Apache 2.2 w/ Passenger MySQL Database PHP: Apache 2.2 w/ MPM worker and Fast CGI MySQL Database In one of my Rails apps running the above setup, I'm at roughly 80mb RAM idle, and for

[Rails] Re: Rails vs PHP in resource usage

2009-07-19 Thread Mike C
Could I get some details on why it does take more resources and what I can do to minimize resource usage as much as possible? On Jul 19, 2:09 am, snacktime snackt...@gmail.com wrote: On Sun, Jul 19, 2009 at 12:36 AM, Mike C snib...@gmail.com wrote: I'd like to know if Rails requires

[Rails] Re: plugins still exist even though they're deleted?

2009-06-21 Thread Mike C
What do you mean? When I deleted them from my local machine I just deleted the folder (dragged into trash and emptied). On Jun 20, 10:15 pm, Phlip phlip2...@gmail.com wrote: Mike C wrote: So I deleted some plugins from my app on my local machine and pushed the changes to my git repository

[Rails] Re: plugins still exist even though they're deleted?

2009-06-21 Thread Mike C
Thanks, that seems to have done the trick since but I'll test again to make sure. What does that -a option do? On Jun 21, 4:48 am, Rakoth rakot...@gmail.com wrote: try git commit -a -m 'comment' --~--~-~--~~~---~--~~ You received this message because you are

[Rails] plugins still exist even though they're deleted?

2009-06-20 Thread Mike C
So I deleted some plugins from my app on my local machine and pushed the changes to my git repository. Using capistrano to update the code, I found that the plugins still exist in the current directory! Does anyone have any ideas as to what is causing this?

[Rails] Re: cap deploy with no password

2009-06-17 Thread Mike C
But the deployment server and the git repository are the same server in my case. What should I do? On Jun 17, 1:47 am, Andrew Porter a...@defsdoor.org wrote: Mike C wrote: Er well it worked but it still asks for a password. You see, for doing git push it used to ask for a password

[Rails] Re: cap deploy with no password

2009-06-17 Thread Mike C
Anyone have any ideas? On Jun 17, 2:42 am, Mike C snib...@gmail.com wrote: But the deployment server and the git repository are the same server in my case. What should I do? On Jun 17, 1:47 am, Andrew Porter a...@defsdoor.org wrote: Mike C wrote: Er well it worked but it still asks

[Rails] Re: cap deploy with no password

2009-06-17 Thread Mike C
the pub key to a file ~/.ssh/authorized_keys set the permission to 600 (chmod 600 ~/.ssh/authorized_keys) then do ssh localhost On Jun 17, 1:09 pm, Mike C snib...@gmail.com wrote: Anyone have any ideas? On Jun 17, 2:42 am, Mike C snib...@gmail.com wrote: But the deployment server

[Rails] cap deploy with no password

2009-06-16 Thread Mike C
Each time I use cap deploy I have to type in the password for the user I assigned to do cap deploy. This is getting kind of annoying, so I'm wondering how I can do this without having to type in the password each time. --~--~-~--~~~---~--~~ You received this

[Rails] Re: cap deploy with no password

2009-06-16 Thread Mike C
I did that but it's still asking for passwords. On Jun 16, 6:34 pm, Maurício Linhares mauricio.linha...@gmail.com wrote: You'll have to setup your SSH keys to the server where the application is being deployed -http://pkeck.myweb.uga.edu/ssh/ - Maurício

[Rails] Re: cap deploy with no password

2009-06-16 Thread Mike C
Er well it worked but it still asks for a password. You see, for doing git push it used to ask for a password but it doesn't anymore, and using cap deploy:update_code used to ask for the password 3 times but now it only asks for it once. On Jun 16, 7:12 pm, Maurício Linhares

[Rails] Re: appending conditions in a model

2009-05-15 Thread Mike C
Yeah, that helps a lot. I actually realized that a little bit after posting and looked it up on Google, but this confirms it. Thanks! On May 15, 9:19 am, Marnen Laibow-Koser mar...@marnen.org wrote: On May 14, 4:28 pm, Mike C snib...@gmail.com wrote: I have a Search Model which contains

[Rails] Re: appending conditions in a model

2009-05-15 Thread Mike C
| kws = keywords.split(/ /); { :conditions = [kws.map { |k| 'title LIKE ?' }.join(' AND '), *(kws.map { |k| %#{k}% })] } } end and so on for user, where you can now add options like :joins and/ or :include if user is defined on another table. --Matt Jones On May 14, 3:28 pm, Mike C snib

[Rails] appending conditions in a model

2009-05-14 Thread Mike C
I have a Search Model which contains search data. It looks like this: keywords:string by_user:boolean by_title:boolean ... So basically what I want is, if one of the booleans is true it will search that particular index. So if by_user is true and by_title is true, it will search the database of

[Rails] Getting 500 Errors on production...

2009-05-05 Thread Mike C
I'm getting 500 errors on my production server running Passenger. I cannot, for the life of me, find out what the problem is. Everything works fine on my local machine. However, on my production machine, I can't even get logs since I don't know where Passenger keeps the logs. So I'm scrolling

[Rails] Re: Getting 500 Errors on production...

2009-05-05 Thread Mike C
for production? What database. Inquiring minds want to know. :) Cheers-- Charles On Tue, May 5, 2009 at 1:00 AM, Mike C snib...@gmail.com wrote: I'm getting 500 errors on my production server running Passenger. I cannot, for the life of me, find out what the problem is. Everything works fine

[Rails] Re: Getting 500 Errors on production...

2009-05-05 Thread Mike C
, May 5, 2009 at 12:35 PM, Mike C snib...@gmail.com wrote: Hi, the problem has been fixed but I was basically shooting in the dark and happened to get a hit. I'm using Debian 5.0 with MySQL 5 for my production. How does Passenger keep its logs, if any? On May 5, 7:20 am, Charles Johnson

[Rails] flash integration

2009-04-17 Thread Mike C
Does anyone here know any good sites/tutorials on how to integrate Adobe Flash and Rails? I know there's stuff out there for Flex, but I'm looking for just Flash. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby

[Rails] changing database structure without wiping

2009-04-08 Thread Mike C
I've decided to make a major change in my application which affects more than 1 model. I don't want to wipe all the data though. Here's the scenario I'm in: I have a Book model with a Chapter model. Book has many Chapters and Chapter belongs to Book. However, I want to add a Story model between

[Rails] create entry using another entry

2009-04-01 Thread Mike C
I'm wondering what the best practice way to do this is. Basically, I have a Snippet model containing a text field of type text and a Story model also with a text field of type text. At some point, I want to make a story entry using a snippet entry's text. Passing this using

[Rails] Re: capistrano error: not allowed to execute '/usr/bin/nohup script/spin'

2009-03-16 Thread Mike C
Oh, so I have to create the spin script myself? On Mar 16, 6:28 am, Commander Johnson commanderjohn...@gmail.com wrote: The page you mentioned looks very much updated now. A while ago the 'spin' script was not well documented here. If you use subversion, don't forget to add the svn:executable

[Rails] RAND() for MySQL, RANDOM() for SQLite

2009-03-16 Thread Mike C
I'm trying to pick some random rows from my database; for development I use SQLite and for production I use MySQL. However, as the title suggests, they both have different ways to get random rows. How can I abstract this away? --~--~-~--~~~---~--~~ You received

[Rails] Re: Observers and outside methods

2009-03-16 Thread Mike C
Oh, ok. Thanks for the replies! On Mar 16, 8:17 am, Craig Demyanovich cdemyanov...@gmail.com wrote: If what I want to accomplish affects only the model with which I'm working, I put the behavior in a callback on the model. If it affects other related models, I put it in an observer.

[Rails] Re: RAND() for MySQL, RANDOM() for SQLite

2009-03-16 Thread Mike C
Thanks! That did the trick. :) But I'm still curious as to how you would generally abstract away something you want to do independent of the database. On Mar 16, 1:34 pm, Philip Hallstrom phi...@pjkh.com wrote: I'm trying to pick some random rows from my database; for development I use

[Rails] Capistrano deploy errors

2009-03-15 Thread Mike C
Hi, when I do cap deploy:cold I get this error: rake aborted! undefined local variable or method `acts_as_commentable' for #Class: 0x7fa1c34a2f10 /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ base.rb:1833:in `method_missing_without_paginate'

[Rails] Re: Capistrano deploy errors

2009-03-15 Thread Mike C
, Michael Graff skan.gryp...@gmail.com wrote: On Sun, Mar 15, 2009 at 3:49 PM, Mike C snib...@gmail.com wrote: Hi, when I do cap deploy:cold I get this error: rake aborted! undefined local variable or method `acts_as_commentable' for #Class: 0x7fa1c34a2f10 I hate to ask the obvious

[Rails] Re: Capistrano deploy errors

2009-03-15 Thread Mike C
Fixed the error. I had to remove the .git and .gitignore directory and file from the plugin directories individually. On Mar 15, 2:02 pm, Mike C snib...@gmail.com wrote: I just checked and the plugin directory is in the source, but after you mentioned that I took a look inside the directory

[Rails] encryption error

2009-03-15 Thread Mike C
I'm using authlogic. On my local machine everything runs fine, but on my production server it's giving me an error, telling me that crypted_password can't be null when I try and create the admin user. I look at the error and notice that everything that's supposed to be encrypted or use a

[Rails] Re: encryption error

2009-03-15 Thread Mike C
Error fixed. I was using restful auth before and switched over to authlogic, but forgot to remove some code that restful auth put in my User model. On Mar 15, 5:36 pm, Mike C snib...@gmail.com wrote: I'm using authlogic. On my local machine everything runs fine, but on my production server

[Rails] capistrano error: not allowed to execute '/usr/bin/nohup script/spin'

2009-03-15 Thread Mike C
I get the error that my assigned user isn't allowed to execute script/ spin. I checked in my current/ directory and there is no script/spin file. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk

[Rails] Using LIKE

2009-03-13 Thread Mike C
I've heard that using LIKE is very slow, but I see it being used a lot in examples, blogs etc. Is it really that bad? Since Rails doesn't directly support Fulltext search, this is the easiest way to get searching done, right? Or are there any other easier ways? I'm using acts_as_indexed right

[Rails] Re: Using LIKE

2009-03-13 Thread Mike C
, Mike C snib...@gmail.com wrote: I've heard that using LIKE is very slow, but I see it being used a lot in examples, blogs etc. Is it really that bad? Since Rails doesn't directly support Fulltext search, this is the easiest way to get searching done, right? Or are there any other easier ways

[Rails] Re: Using LIKE

2009-03-13 Thread Mike C
  functions that are faster, but again I believe are postgres only. Anyway, just something to keep in mind if you think your app might be   run with different backends. -philip On Mar 13, 11:06 am, Charles Johnson gm.johns...@gmail.com wrote: On Fri, Mar 13, 2009 at 12:42 PM, Mike C snib

[Rails] Observers and outside methods

2009-03-13 Thread Mike C
I'm thinking about using observers for my situation. Basically whenever an object is created, I want a message to be sent to a user via a PM system I made. At the moment this is happening within the create method of the controller. I tried putting this in a callback in the model, but it seems

[Rails] Re: Validate field not in model?

2009-02-27 Thread Mike C
Nevermind, getter was returning a user object instead of a string. fixed. :) On Feb 26, 10:10 pm, Mike C snib...@gmail.com wrote: Ok, I did it. But in the model I have validates_presence_of, and even though the field is filled, I keep getting the blank error. On Feb 26, 9:52 pm, CFC zuso

[Rails] Getting unique entries from models?

2009-02-27 Thread Mike C
I'm using acts_as_taggable_on and I want to get a list of unique taggings. How can I do this? In a more general sense, say that I have a Product model with attributes name and price. I have these: id: 1 Name: Juice Price: 5 id: 2 Name: Juice Price: 5 So when I do a Product.find(:all) I'll get

[Rails] Re: Getting unique entries from models?

2009-02-27 Thread Mike C
Thanks for the help. That was just an example, not a good one, but I just needed to explain the problem I'm having. It had nothing to do with acts_as_taggable_on, but I might as well just directly tell my problem. I want to display all the tags that a tagger has used. However, using

[Rails] Validate field not in model?

2009-02-26 Thread Mike C
I want to validate a field in my form that's not an attribute in the model. How do I do this? --~--~-~--~~~---~--~~ 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

[Rails] Re: Validate field not in model?

2009-02-26 Thread Mike C
Ok, I did it. But in the model I have validates_presence_of, and even though the field is filled, I keep getting the blank error. On Feb 26, 9:52 pm, CFC zuso...@gmail.com wrote: define it as a getter and setter. On Fri, Feb 27, 2009 at 10:49 AM, Mike C snib...@gmail.com wrote: I want

[Rails] acts as indexed suitable?

2009-01-27 Thread Mike C
I'm using the acts as indexed to sort of implement a full text search for titles of stories. This is working perfectly, but it seems it stores these indexes in files. This worries me since I fear there may be a lot of IO which could be slow since it doesn't seem to scale. Any comments on this are

[Rails] Re: Removing p from RedCloth

2009-01-13 Thread Mike C
Thanks, that's getting closer to what I want. :) But I'd still like things enabled such as lists...does that have further options like a whitelist? On Jan 12, 4:21 pm, Adam Kittelson adam.kittel...@apathydrive.com wrote: This may or may not help you depending on which RedCloth functionality you

[Rails] Re: Removing p from RedCloth

2009-01-13 Thread Mike C
: foo.to_html.gsub(/\/?p/, '') On Tue, Jan 13, 2009 at 2:12 PM, Mike C snib...@gmail.com wrote: Thanks, that's getting closer to what I want. :) But I'd still like things enabled such as lists...does that have further options like a whitelist? On Jan 12, 4:21 pm, Adam Kittelson adam.kittel

[Rails] Removing p from RedCloth

2009-01-12 Thread Mike C
Everytime I do to_html with RedCloth it wraps the entire thing in p which is really annoying. I've looked all over for an answer on how to disable this but I've found nothing. I'm surprised that I'm the only one that doesn't want my stuff wrapped in p tags. Does anyone know how to disable this?

[Rails] Textile and h problems

2009-01-11 Thread Mike C
I installed Redcloth into my app so that it could use Textile. However, it seems that textilize (the function used to parse the Textile stuff) and h aren't compatible. If I do %= textilize h @mymessage % it doesn't work. If I take out the h it works but then I leave myself open to XSS. Is there a

[Rails] Re: Textile and h problems

2009-01-11 Thread Mike C
: h(textilize(@mymessage)) - Ryan Bigg Freelancerhttp://frozenplague.net On 12/01/2009, at 2:50 PM, Mike C wrote: I installed Redcloth into my app so that it could use Textile. However, it seems that textilize (the function used to parse the Textile stuff) and h aren't compatible

[Rails] Re: RoR 2.2.2 and MySQL -- HELP

2009-01-07 Thread Mike C
I'm having this EXACT same error and was about to post asking for help. That last post by Fred fixed it. :) However, something weird happened. I have a database called testapp and it says it can't find it...I also had 2 mysql_config files on my system.

[Rails] How do booleans work?

2009-01-04 Thread Mike C
I'm a little confused as to how booleans work in Rails. Which is better in the database? boolean or int(1)? True == 1 and False == 0, right? Using SQLite, I tried to set a value to true inside the database but it gave me an error. MySql didn't, so I had to switch to int(1) for it to work. Is this

[Rails] will_paginate overwriting my user.rb?

2009-01-03 Thread Mike C
In the will_paginate plugin/gem lies a file /test/fixtures/user.rb. It seems that that user.rb is somehow overriding app/model/user.rb. How is it doing this? What can I do to stop it from destroying my app? --~--~-~--~~~---~--~~ You received this message because

[Rails] Very odd NoMethodError/stack overflow....

2009-01-02 Thread Mike C
I'm getting this very weird error and I can't figure out what the problem is. I'm using acts_as_commentable. Basically, I have a partial with this code in it: div id=%= '#{comment.commentable_type}_comment_# {comment.commentable_id}' % class=comment dl dt%= link_to

[Rails] Re: Very odd NoMethodError/stack overflow....

2009-01-02 Thread Mike C
class Comment ActiveRecord::Base belongs_to :commentable, :polymorphic = true # NOTE: install the acts_as_votable plugin if you # want user to vote on the quality of comments. #acts_as_voteable # NOTE: Comments belong to a user belongs_to :user end class Story

[Rails] Undefined method exists?

2008-11-10 Thread Mike C
I'm getting the error that exists? is an undefined method when I try and use it in a model. Basically, it's something like this: if exists? :user_id = current_user.id From what I understand, exists? is in ActiveRecord::Base so a model should be able to use it, right? I've used find()

[Rails] Re: Undefined method exists?

2008-11-10 Thread Mike C
So what's the proper way to use it? self.exists? doesn't work either...can I only do User.exists?? On Nov 10, 2:31 am, Frederick Cheung [EMAIL PROTECTED] wrote: On 10 Nov 2008, at 10:20, Mike C wrote: I'm getting the error that exists? is an undefined method when I try and use

[Rails] Very weird rake message...

2008-11-10 Thread Mike C
When I try and run rake db:migrate, I get this error: rake aborted! uninitialized constant CreateUsers /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:266:in `load_missing_constant' /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/

[Rails] Re: Very weird rake message...

2008-11-10 Thread Mike C
 pm, Mike C [EMAIL PROTECTED] wrote: When I try and run rake db:migrate, I get this error: rake aborted! uninitialized constant CreateUsers /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/ dependencies.rb:266:in `load_missing_constant' /Library/Ruby/Gems/1.8/gems

[Rails] Re: Very weird rake message...

2008-11-10 Thread Mike C
*sigh* nevermind again, the issue isn't solvedstill getting the same error. On Nov 10, 8:58 pm, Mike C [EMAIL PROTECTED] wrote: Actually I missed one reference...fixed it. But now I'm getting this error: rake aborted! No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb

[Rails] Re: Very weird rake message...

2008-11-10 Thread Mike C
Nope, I made sure to change the migrations file name 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

[Rails] Updating plugins

2008-10-09 Thread Mike C
Just wondering, when I want to update a plugin, do I have to reinstall it and do everything over again or is there any easier way? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to