[Rails] conditional ajax call after page is loaded

2010-09-09 Thread dino d.
Hi - I have an app where the user can submit a query and the page gets updated dynamically. Right now, the user types in a query with a remote_form_tag. I'd like to add the ability to encode the search term in the URL itself, so the query is shareable, in addition to being able to manually type i

[Rails] Re: send_file from URL?

2010-07-08 Thread dino d.
thanks for the response. you'll notice i posted in the original "because I want to conceal the cloud URL" On Jul 8, 3:18 pm, Robert Walker wrote: > dino d. wrote: > > send_file "http://www."; > > > but it cannot find the file: > > > Cannot

[Rails] send_file from URL?

2010-07-08 Thread dino d.
hi - i have a URL of an image (on cloud storage) and I want to send the file from a request. I do not want to redirect because I want to conceal the cloud URL. So I want to do something like: send_file "http://www."; but it cannot find the file: Cannot read file http://... but, the url i

[Rails] can access the through attributes from the many with has_many through?

2010-05-11 Thread dino d.
hi - if i have A has_many B A has_many C through B Is there any way to retrieve the B attributes once I have a C object? For example: class User < ... has_many :friend_links has_many :friends, :through => :friend_links, :class => User ... friends = user.friends for f in friends link = f.fr

[Rails] Re: can i access global cookies from rails?

2010-04-30 Thread dino d.
thanks for the reply. i screwed up. in development mode, i was accessing my localhost, which was storing the cookie under localhost. when i accessed my app from the domain that i registered with facebook, i got access using the regular cookies array. hope this helps someone... thanks again, dino

[Rails] can i access global cookies from rails?

2010-04-30 Thread dino d.
hi - i'm trying to integrate facebook authentication into my app. facebook sets a cookie called fbs_ where is your app id. but, i can't figure out how to get my hands on that that cookie inside rails, cookies[] only gives me access to my apps cookies. thanks for any help, dino -- You

[Rails] Can a server make a post to itself?

2010-02-26 Thread dino d.
Hi- I have a rails app where a form gets submitted, and that data from the form has to be validated. It's a widget app, so other sites will use the validation routine, but I also want to use it myself, from the same server that does the validation. So, is it possible for a ruby instance to send

[Rails] Re: auto_complete always selects the first item, can i prevent this?

2010-02-09 Thread dino d.
i did find this solution, but i'm not crazy about it: https://prototype.lighthouseapp.com/projects/8887/tickets/116-ajaxautocompleter-default-selects-first-item On Feb 9, 3:18 pm, "dino d." wrote: > if you use google or yahoo's search autocomplete, you'll see t

[Rails] auto_complete always selects the first item, can i prevent this?

2010-02-09 Thread dino d.
if you use google or yahoo's search autocomplete, you'll see that they do not select the first item automatically. this way, if you don't choose an item, and hit return, the return submits the form. is there a way to make this work with auto_complete? in other words, i'd like it to behave like t

[Rails] Re: text_field_with_auto_complete without a model

2010-02-09 Thread dino d.
valid token problem) hope this helps someone down the road. dino On Feb 9, 11:02 am, "dino d." wrote: > hi- > > is this possible? basically, i have a simple search text box whose > contents i want to send to my server to suggest a query.  that > suggested query will be

[Rails] text_field_with_auto_complete without a model

2010-02-09 Thread dino d.
hi- is this possible? basically, i have a simple search text box whose contents i want to send to my server to suggest a query. that suggested query will be in turn retrieved from a 3rd party API. I cannot figure out for the life of me how to use text_field_with_auto_complete without a model. ba

[Rails] can use use observe_field with a 3rd party server?

2010-02-08 Thread dino d.
Hi- I'm trying to implement an auto-complete using Yahoo's autocomplete server, which basically suggests search completions: http://ff.search.yahoo.com/gossip?output=fxjson&command={your searchterms}' if you want to see the results in your browser, use xml instead: http://ff.search.yahoo.com/go

[Rails] Can only get RMagick to work writing with 777

2010-01-25 Thread dino d.
Hi - I am at a loss with chmod. The only way I can get RMagick to work properly writing to a file is if I set the dir to 777 permissions, but I feel like this is a huge security risk. Can someone give me a push in the right direction with chown/chmod, etc. for RMagick? All I want is for everyon

[Rails] is there a beta plugin that requires a beta code to allow access?

2010-01-24 Thread dino d.
hi - i want to do some testing with live users, as many people have done before me. has someone encapsulated this in a simple plugin that requires a beta password? thanks, dino -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to

[Rails] change the interval in periodically_call_remote

2010-01-13 Thread dino d.
I'd like to make a div that updates itself. That div will contain a timer. If there is an hour left, I'd like to refresh it every 10 minutes, but if the time has only one minute left, I'd like to have it call the server every second. If the periodically_call_remote is inside the div, will it be

[Rails] eager loading with dynamic conditions?

2009-10-29 Thread dino d.
If I have an association A habtm B and I say A.find.., :include => B but I only want some of the B's to be loaded, the rails docs (http:// ar.rubyonrails.org/classes/ActiveRecord/Associations/ ClassMethods.html) say: If you do want eagerload only some members of an association it is usually mo

[Rails] remove 1 HABTM association at a time

2009-09-17 Thread dino d.
hi - i have two models, A and B, and each habtm the other if I do a = A.new b = B.new a.bs << b a.bs << b a.bs << b this creates 3 records in the join table. Is there any way for me to remove only one of these? I can only seem to remove all of them. thanks for any help, dino --~--~---

[Rails] extract keywords from string

2009-08-23 Thread dino d.
hi - i have strings that i need to extract keywords from. the string might have html tags, urls, etc. i need to extract the keywords from the string. i imagine i'm not the first guy to have to tackle this problem. is there a gem i can use or anyone have any ideas how to approach this? thanks

[Rails] help with libxml

2009-08-19 Thread dino d.
hi - i'm pulling my hair out. the find method simply won't work for me. here's my xml doc: that's it. now after parsing, i do doc.find('/top/first') and i get a result with size 0. i've tried everything. is there a trick to using libxml that i'm missing? thanks, for any help, dino -

[Rails] select_tag with multiple set to true returns a String in params instead of array

2009-05-05 Thread dino d.
Hi - I'm trying to get a multi-select box working. The form shows up fine, and I can select multiple items fine, but in the controller, the parameter shows up as a single string, instead of an array of values. Any ideas? The form: <%=select_tag "items", @items, :multiple => true :onchange => "t

[Rails] help replacing all @user patterns with link (regular expressions)

2009-04-06 Thread dino d.
Hi - I want to add a feature to my comment forum where anytime someone types in @username, I can grab the username, make sure it's valid, and if so, replace it with a link to that user's profile. So, I think I want something like: comment = comment.gsub("/@[A-Za-z0-9]*/", ?) How do I grab the

[Rails] Can RJS render new javascript?

2009-03-30 Thread dino d.
Hi - I'm trying to create a widget where my rails code generates a fresh widget (which is javascript) to replace the old one. To do this, I need to insert new javascript with AJAX with RJS (so my partial begins with http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~---

[Rails] Re: config.cache_classes breaks reflect_on_assocation ?

2009-02-19 Thread dino d.
;s own model object? thanks again, dino On Feb 19, 6:02 pm, Frederick Cheung wrote: > On 19 Feb 2009, at 20:50, dino d. wrote: > > > > > This works fine, unless I enable config.cache_classes, then, the first > > user who accesses the site after the server is restarted gets

[Rails] config.cache_classes breaks reflect_on_assocation ?

2009-02-19 Thread dino d.
Hi - I have a model with a user-specific has_one relationship, meaning, my model, Story, has one Vote, but only on a per-user basis. So, I addressed this issue by adding a has_one relationship: has_one :current_user_vote, :class_name => 'Vote', :conditions => "user_id = #{Story.current_user ? S

[Rails] Re: how to reduce memory footprint of a rails app

2009-02-15 Thread dino d.
tart in my controllers or models, etc.? i have no experience whatsoever in assessing where memory is used in a rails app and would appreciate any common patterns of opportunity for mem reduction. thanks a lot. dino On Feb 15, 11:08 am, Roderick van Domburg wrote: > dino d. wrote: > > My

[Rails] how to reduce memory footprint of a rails app

2009-02-15 Thread dino d.
Hi- My app has reached the memory limit allotted by my host. Can someone tell me how I go about reducing the memory footprint? Does rails load every single gem it finds, and can I somehow throw away the ones I don't need? Any other advice or suggestions for strategies or tools to diagnose wher

[Rails] gahh! how do you install the query_trace plugin?

2009-02-06 Thread dino d.
Hello- I am trying to install the query_trace plugin here: http://github.com/ntalbott/query_trace/tree/master I can't figure out how to install it. I've tried script/install plugin, I've tried svn, I've tried downloading the files and placing them in the vendor/plugins directory, nothing seems

[Rails] eager loading kills the :select clause in ActiveRecord

2009-01-29 Thread dino d.
hi I've dramatically improved my SQL performance with eager loading, but the problem is, it kills the :select directive because it generates its own (it ONLY selects the table fields and eager loaded table fields). Is there a way around this? I have some left outer joins in my :joins clause, a

[Rails] Re: conceptual confusion with facebook connect

2009-01-13 Thread dino d.
I'm getting closer to an answer, I found this link which talks about linking accounts (your users and facebook users): http://wiki.developers.facebook.com/index.php/Account_Linking If I get this working, I'll post an update. Dino On Jan 12, 9:22 pm, "dino d." wrote: &

[Rails] Re: conceptual confusion with facebook connect

2009-01-12 Thread dino d.
FB connect. Now what? How do I keep track of this users comments? I've read both of those links but they don't really address how you treat a facebook user as a data point in your site. On Jan 12, 5:40 pm, "Conrad Taylor" wrote: > On Mon, Jan 12, 2009 at 2:25 PM, dino d

[Rails] conceptual confusion with facebook connect

2009-01-12 Thread dino d.
Slightly off topic, but I'm exploring FB connect integration with my rails site. Right now I have an application with a User model, and that user model links to all of my other models, such as comments, votes, etc. As I understand it, FB connect lets users log in without having to log in to my s

[Rails] textarea clear in RJS stopped working with 2.1.1

2008-12-19 Thread dino d.
Hi - I have an RJS that says page["textarea_id"].clear that works fine with rails 2.0.2 but is broken with 2.1.1 - I get an error message: ActionView::TemplateError (undefined method `[]' for #) So, how do I clear a text_area now? Also, is there a reference for page somewhere? Thanks, Dino -

[Rails] validates_uniqueness_of only if present

2008-11-19 Thread dino d.
Hi - I want to allow duplicate fields values if the field is blank, but disallow duplicates if it's not. Is there a validates_uniqueness_of_if_present equivalent? Thanks, Dino --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[Rails] Re: how to make an image grow and make everything else dark until you click close

2008-11-18 Thread dino d.
Thanks, works great! Dino On Nov 18, 1:34 pm, Jodi Showers <[EMAIL PROTECTED]> wrote: > Hey Dino - > On 18-Nov-08, at 1:29 PM, dino d. wrote: > > > > > Anyone know an easy way to do this?  I have some web links in my app > > with pictures, and I'd like to

[Rails] how to make an image grow and make everything else dark until you click close

2008-11-18 Thread dino d.
Anyone know an easy way to do this? I have some web links in my app with pictures, and I'd like to implement that effect that I've seen a lot where when the user clicks on the image, it sort of grows and the rest of the page becomes dark until the user clicks close (or clicks the picture). Is th

[Rails] Re: can load gem with irb but application fails

2008-10-23 Thread dino d.
On Oct 23, 9:23 am, "Craig Demyanovich" <[EMAIL PROTECTED]> wrote: > It sounds like your app is relying on the gems installed on the production > server. Instead, you should consider bundling your gems with your app. Good ahh, so there's more to it than just the $GEM_PATH and $GEM_HOME env var

[Rails] can load gem with irb but application fails

2008-10-23 Thread dino d.
Hi- I'm trying to load the blackbook gem. I had it working at one point and don't recall how I broke it. Anyway, right now, I can load it in irb and I get 'true' (success). The app dies, however and I get this in the log: MissingSourceFile (no such file to load -- blackbook): /usr/local/l

[Rails] Re: recreated app and now it can't load OpenSSL

2008-10-22 Thread dino d.
well, as far as i know, i don't purposely use openssl, anyway, i've recompiled ruby and that problem is now solved. now i can load the blackbook gem from irb, but it still dies from the application, i get: MissingSourceFile (no such file to load -- blackbook) but in irb if i do require 'black

[Rails] recreated app and now it can't load OpenSSL

2008-10-22 Thread dino d.
hi - i have a hosted app on dreamhost, i made some change to environment.rb and it totally screwed up my app. I cannot remember what i did. So, i decided to recreate it by deleting environment.rb and running rails myapp. everything works fine, except when use one of my controllers, it dies. t

[Rails] runner task cannot find a gem

2008-09-29 Thread dino d.
Hi - I have a cron job that won't work. I have installed a gem which works fine in the app, but the cron job fails, saying: These gems that this application depends on are missing: - blackbook Run "rake gems:install" to install them. I think this has to do with the path, I had to add the gem

[Rails] Re: how do i use a newly installed gem?

2008-09-10 Thread dino d.
SOLVED! The problem was that since the installer failed, I had to install without dependencies. Apparently, I forgot to manually install fastercsv, but instead of throwing a message like 'no fastercsv,' it said 'no such file to load.' Thanks for your help guys. dino On Sep

[Rails] Re: how do i use a newly installed gem?

2008-09-09 Thread dino d.
;hpricot", :version => '0.6', :source => > "http://code.whytheluckystiff.net"; > > > > dino d. wrote: > > I didn't originally, but now I did.  I added: > > > require 'blackbook' > > > and now, I get > > > no s

[Rails] Re: how do i use a newly installed gem?

2008-09-09 Thread dino d.
ere. this error tells me it can't find blackbook.rb. Any ideas? Thanks, Dino On Sep 9, 4:47 pm, John Yerhot <[EMAIL PROTECTED]> wrote: > Did you require the gem? > > On Sep 9, 3:37 pm, "dino d." <[EMAIL PROTECTED]> wrote: > > > Hi - I wanted to try

[Rails] how do i use a newly installed gem?

2008-09-09 Thread dino d.
Hi - I wanted to try out the Blackbook gem: http://contentfree.rubyforge.org/blackbook/ So I did gem install blackbook and I kept getting failures installing, and finally I used the -- ignore-dependencies flag in gem install, and I got it installed. Now I try to do something very simple like