Re: [Rails] Re: Attach an action to a partial?

2010-01-15 Thread James Englert
Like a tile controller from the java world I would suppose. Essentially a block of code in an .rb file that gets executed every time the partial is rendered. I don't think you can do that? Can you? On Fri, Jan 15, 2010 at 9:00 AM, Marnen Laibow-Koser li...@ruby-forum.comwrote: Aldric

Re: [Rails] Re: Re: Attach an action to a partial?

2010-01-15 Thread James Englert
Well yes... That's not really quite the same though... On Fri, Jan 15, 2010 at 9:14 AM, Marnen Laibow-Koser li...@ruby-forum.comwrote: James Englert wrote: Like a tile controller from the java world I would suppose. Essentially a block of code in an .rb file that gets executed every time

Re: [Rails] Re: Re: Re: Attach an action to a partial?

2010-01-15 Thread James Englert
Maybe I'm misunderstanding you. Your talking about putting a helper in a view, right? So %= my_helper % would be the code? On Fri, Jan 15, 2010 at 9:25 AM, Marnen Laibow-Koser li...@ruby-forum.comwrote: [Please quote when replying. This is a mailing list, not just a Web forum.] James

Re: [Rails] Re: Re: Re: Re: Attach an action to a partial?

2010-01-15 Thread James Englert
-forum.comwrote: James Englert wrote: Maybe I'm misunderstanding you. Your talking about putting a helper in a view, right? So %= my_helper % would be the code? Well, it would call FooHelper#my_helper, which would contain the code. On Fri, Jan 15, 2010 at 9:25 AM, Marnen Laibow-Koser

[Rails] Determining source of a file

2009-11-27 Thread James Englert
Hey All, Hopefully this isn't the most complex question in the world... How can you determine the source file that a Class is using? For example, I'd like to find the source file on my hard drive that is supporting the class Feed in the below example.

Re: [Rails] Determining source of a file

2009-11-27 Thread James Englert
I'm debugging an issue and I'd like to rule out the possibility that my system is pulling a particular library from an incorrect location. -Jim On Fri, Nov 27, 2009 at 12:47 PM, Conrad Taylor conra...@gmail.com wrote: On Fri, Nov 27, 2009 at 9:33 AM, James Englert englert.ja...@gmail.comwrote

Re: [Rails] Determining source of a file

2009-11-27 Thread James Englert
, James Englert englert.ja...@gmail.comwrote: I'm debugging an issue and I'd like to rule out the possibility that my system is pulling a particular library from an incorrect location. -Jim On Fri, Nov 27, 2009 at 12:47 PM, Conrad Taylor conra...@gmail.comwrote: On Fri, Nov 27, 2009 at 9:33

[Rails] Re: Console/Server fetching different gems

2009-11-10 Thread James Englert
Yeah. I've tried both requiring the file and using the config.gem. I didn't have much luck either way. On Mon, Nov 9, 2009 at 1:03 AM, Sijo k g rails-mailing-l...@andreas-s.netwrote: Hi James Englert Have you configured gem in config/environment.rb using config.gemand also require

[Rails] Re: Console/Server fetching different gems

2009-11-10 Thread James Englert
the gems? On Mon, Nov 9, 2009 at 9:32 AM, Matt Jones al2o...@gmail.com wrote: On Nov 8, 3:12 pm, James Englert englert.ja...@gmail.com wrote: Hey All, I'm running into a situation where ruby script/server and ruby script/console are apparently not pulling gems from the same directory

[Rails] Console/Server fetching different gems

2009-11-08 Thread James Englert
Hey All, I'm running into a situation where ruby script/server and ruby script/console are apparently not pulling gems from the same directory. Ex: $ ruby script/console require 'nokogiri' = [] Nokogiri =Nokogiri When I do it with script/server I get the following behaviour $ ruby

[Rails] Re: Flash Messages based on login session?

2009-10-03 Thread James Englert
I'm not aware of any features that would do that automatically. I would think your best bet would be to just store those messages for next time in the database. Hope that helps, Jim http://www.thepeoplesfeed.com/ On Sat, Oct 3, 2009 at 1:12 PM, David Chua zhc...@gmail.com wrote: Hi guys,

[Rails] Re: Encode and Encrypt Email Addresses

2009-09-28 Thread James Englert
It might be possible to use another key from that table (perhaps you have an ID column) and use that to unsubscribe users. Is anything like that possible? On Mon, Sep 28, 2009 at 3:12 PM, TomRossi7 t...@themolehill.com wrote: I want to provide a link for users to unsubscribe to our

[Rails] Re: How to see HTTP requests as they are received?

2009-09-22 Thread James Englert
You can download firebug for firefox. If you go into the net tab, it should provide you a pretty good idea of what is being requested. -Jim On Tue, Sep 22, 2009 at 9:06 AM, Patrick Doyle wpds...@gmail.com wrote: Hello Experts! I am debugging a problem with one of my controllers in my

[Rails] Re: What's the correct way to delete old sessions

2009-09-20 Thread James Englert
I feel like I'm missing a major point here. Assuming the table is correctly range partitioned and indexed, most databases should be able to handle relatively large table sizes. I agree that is a best practice to archive old, unused data, but that can likely be done on a monthly basis, or less

[Rails] Re: Counter cache help

2009-09-11 Thread James Englert
= ?, user_id ] } } end Sorry for the confusion, JIm On Fri, Sep 11, 2009 at 3:12 AM, Eric ericgh...@gmail.com wrote: Singularize your model names: Comment TestCase -e On Sep 10, 8:50 pm, James Englert englert.ja...@gmail.com wrote: My :counter_cache column isn't working properly. I wouldn't

[Rails] Re: Counter cache help

2009-09-11 Thread James Englert
Figured it out. TestCase is also defined by active record. It will probably be easiest to just rename it from TestCase to something else. On Fri, Sep 11, 2009 at 7:40 AM, James Englert englert.ja...@gmail.comwrote: Thats actually how I originally had it. I was playing around with pluralizing

[Rails] Re: Related JavaScript

2009-09-09 Thread James Englert
Interestingly, the browser apparently can load the page quicker if javascript is at the bottom. http://developer.yahoo.com/performance/rules.html -Jim http://www.thepeoplesfeed.com On Wed, Sep 9, 2009 at 5:08 AM, Abhinav Saxena abhinav...@gmail.com wrote: Ideally, javascript should be kept in

[Rails] Re: Redirect Issues

2009-09-01 Thread James Englert
Do you happen to have a filter that is directing all your users (who are not logged in) to the login page. That way they are going /maybies/categories = /login = /maybies/categories = /login ... etc.. Hope that helps, Jim http://www.thepeoplesfeed.com/contribute On Tue, Sep 1, 2009 at 8:01

[Rails] Re: Redirect Issues

2009-09-01 Thread James Englert
Check if your controller classes and your application_controller.rb for any before_filters. Sometime authentication gems come with this type of functionality. Are you using any? On Tue, Sep 1, 2009 at 8:35 AM, Vijay Ks rails-mailing-l...@andreas-s.netwrote: James Englert wrote: Do you

[Rails] Re: Routes problem

2009-08-28 Thread James Englert
ROR will attempt to find routes from the top of the file first and then move on to the rest of the file. It would seem that you have listed projects twice: map.resources :*projects*, :departments, :users, :admins, :imports, :notes #Below is route in question map.resources :*projects*,

[Rails] HTML in error messages

2009-08-23 Thread James Englert
Hey All, Rails escapes HTML in error message. Does anyone know a way to print an error message without it being escaped? Consider: errors.add_to_base 'Sorry, we were unable to parse the feed you provided. Please double check the URL you have provided. Email the a href=mailto:

[Rails] Re: subdomainfu

2009-08-20 Thread James Englert
Hypothetically, I believe you could configure a local DNS server to redirect *.localhost to your ruby server. I'm not positive though. On Thu, Aug 13, 2009 at 9:11 AM, prabesh shrestha prabesh...@gmail.comwrote: Hi all, I am using subdomainfu plugin for subdomain in my project.I can get

[Rails] Re: bulk email solutions

2009-08-20 Thread James Englert
I've googled a bit and I can't seem to find it. Could you do me a huge favor and link me?! On Thu, Aug 20, 2009 at 5:34 PM, Philip Hallstrom phi...@pjkh.com wrote: Hard to say without knowing how many customers that query is going to return... if it's under a 100 it doesn't matter. Under

[Rails] Re: Secure Form question

2009-08-19 Thread James Englert
You could always do it manually by encoding the ids in questions and storing the encoding in the form as well. On form validation, you could just ensure that the encoded string and the non-encoded string match up. That way, a hacker would need to change both strings to get the thing to work.

[Rails] Re: file include error

2009-08-19 Thread James Englert
I think you can do it using the render command. Check out the section render a file from the following link: http://api.rubyonrails.org/classes/ActionController/Base.html#M000658 Hope that helps, Jim http://www.thepeoplesfee.com/contribute On Wed, Aug 19, 2009 at 2:01 AM, Wap Addon

[Rails] Re: file include error

2009-08-19 Thread James Englert
Something like this: render :file = /path/to/some/template.erb On Wed, Aug 19, 2009 at 8:23 AM, Wap Addon rails-mailing-l...@andreas-s.net wrote: James Englert wrote: I think you can do it using the render command. Check out the section render a file from the following link: http

[Rails] Create! Syntax

2009-08-19 Thread James Englert
Hey All, Two questions. Firstly, what is the difference between create and create! I see that create is document in the api http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002269 What is the difference between the two of these functions and where is the create! function defined.

[Rails] Creating a view through a migration

2009-08-16 Thread James Englert
Does anyone have any experience creating views using migration files. I know that I could create the view using execute syntax but I was wondering if there is a best practice with regards to that? Thanks, Jim --~--~-~--~~~---~--~~ You received this message

[Rails] Re: Strange problem with Rails and Tomcat

2009-08-05 Thread James Englert
Are you updating that DIV with javascript? On Wed, Aug 5, 2009 at 8:17 AM, Rafael Roque rails-mailing-l...@andreas-s.net wrote: Hi all, I´m having a strange problem in my rails app hosted on Tomcat: The 'div' element which stores the validation errors of a model doesn´t seem to be

[Rails] Re: Best Practice: Automatic session timeout/cleanup?

2009-08-03 Thread James Englert
What is your motivation for removing these rows at all? Generally, large database tables that are properly indexed shouldn't pose much of a performance concern. On Mon, Aug 3, 2009 at 3:45 PM, Phoenix Rising polarisris...@gmail.comwrote: I'm developing an application where I need to have all

[Rails] Re: Best practice question...

2009-07-27 Thread James Englert
You might want to memoize the results of that function to prevent unnecessary hits to the database during the same request. On Mon, Jul 27, 2009 at 2:21 PM, Rob Biedenharn r...@agileconsultingllc.comwrote: On Jul 27, 2009, at 12:26 PM, Ashley wrote: Hello guys! Question: Views should

[Rails] Re: using form values

2009-07-27 Thread James Englert
I'm not sure I understand, but I would guess the answer is: td%=h number.m1 * 25 %/td On Mon, Jul 27, 2009 at 4:26 PM, Mark Preston rails-mailing-l...@andreas-s.net wrote: Can anyone tell me how to use form field values on a different part of your form? Example If I have a value being

[Rails] Re: Render html to pic

2009-07-26 Thread James Englert
That's an interesting problem. If you don't mind me asking, why do you need to take screenshots of your websites? On Sun, Jul 26, 2009 at 9:05 AM, blueomega celsoricardoco...@gmail.comwrote: So a need to do a complete print to an image of a website, server side, and doesn't really matters the

[Rails] Re: Rails Authorization and Security question

2009-07-24 Thread James Englert
It would probably be easier to prevent users from viewing those pages using a filter. If you are using AuthenticatedSystem, you might be able to tap into the login_required function. An example filter would be like .. in your controller class .. before_filter :login_required, :except = [:show]

[Rails] Re: production and cache

2009-07-22 Thread James Englert
and part of the view.. a really hard work (ps under tmp/cache i have no files) James Englert wrote: Somehow I thought that was how it worked by default. For example, my site caches files as: ~/thepeoplesfeed/tmp/cache/views/www.thepeoplesfeed.com/... What cache are you using? I'm

[Rails] Re: aptana RadRails

2009-07-21 Thread James Englert
I've used it before without a ton of success. It did offer some helpful features but was too much overhead for me to bother with. I am just a recreational Ruby user however, it might be different if you could devote 8 hours a day to perfecting your use of it. I use TextMate

[Rails] Re: Rails Application Performance...

2009-07-21 Thread James Englert
I would presume that using cookies could open you up to certain security holes and additional programming confusion. Also, ROR is already mainting the session using cookies. The session is provided to you as a construct to avoid additional programming effort. You are kinda sidestepping that by

[Rails] Re: production and cache

2009-07-21 Thread James Englert
Somehow I thought that was how it worked by default. For example, my site caches files as: ~/thepeoplesfeed/tmp/cache/views/www.thepeoplesfeed.com/... What cache are you using? I'm not sure the memory cache splits things by domain. On Tue, Jul 21, 2009 at 11:52 AM, Alessandro Scolavino

[Rails] Re: Ways to chart data in Rails?

2009-07-11 Thread James Englert
I'd check this out. I've never used it but it looks fancy! http://nubyonrails.com/pages/gruff On Sat, Jul 11, 2009 at 5:04 AM, Jessica Smith jessica.1980.sm...@gmail.com wrote: Hi, I am searching for plugins/gems which help me chart data. I'd like to start with something simple like a 2-D

[Rails] Re: Change default view path for an ActionController

2009-07-09 Thread James Englert
I'm pretty sure you can just call render at the end of the action to render whatever you want. http://api.rubyonrails.org/classes/ActionController/Base.html#M000676 I'm not sure you would want to do this though. On Thu, Jul 9, 2009 at 8:55 AM, mike mikez...@gmail.com wrote: Hello all, i

[Rails] Re: Change default view path for an ActionController

2009-07-09 Thread James Englert
Would an after_filter work? On Thu, Jul 9, 2009 at 9:04 AM, mike mikez...@gmail.com wrote: jap thats right. but is there a way to change the default path without actually touching every controller method? On Thu, Jul 9, 2009 at 3:00 PM, James Englert englert.ja...@gmail.comwrote: I'm

[Rails] Re: programmatically add a route

2009-07-08 Thread James Englert
I'm not sure but it seems possible to have a route at the end of your routes file (with the lowest priority) that would handle any un-handled requests. You could then dispatch it to wherever you want. Maybe there is a better way to do it though. Could you give some example URL's? On Wed, Jul 8,

[Rails] RoR alternative to mod_deflate

2009-07-07 Thread James Englert
Hey Everyone, I'm experiencing the following general problem. I have a single instance of mongrel on a shared hosting environment. I'm just a hobbyist so I don't want to have to spend too much on hosting. Some of the files I'm serving through rails, noteably, the sitemap.xml, are relatively

[Rails] Re: Help kill ghost request

2009-07-06 Thread James Englert
Some browsers including firefox (i believe) On Mon, Jul 6, 2009 at 6:34 PM, James Englert englert.ja...@gmail.comwrote: In some browsers, the following tag will result in a second request to the server: img src= / I would look for situations where a blank image/js file/css file, etc

[Rails] Re: has_many relationship - specify how quantity (how many)

2009-07-05 Thread James Englert
I suppose you could write a custom validator to ensure that no more than 5 child objects exist. On Sun, Jul 5, 2009 at 5:12 PM, Michal Burak rails-mailing-l...@andreas-s.net wrote: Hi, Is there any way to specify a a validation rule or something for the has_many' relationship so that it

[Rails] Re: Validation failture

2009-07-03 Thread James Englert
Thats pretty much what I have. Problem is, I still need code in the controller I am submitting to that looks like this: if !item.save # Handle save validation failure end Are you saying that I should not need code like that in my submit controller? If so, is there anything special that needs

[Rails] Validation failture

2009-07-01 Thread James Englert
Say controller x, action a has a form on it that submits to controller y, action b, and validation fails during the submit. I want to display the result of controller x, action a with the validation messages. In psuedocode, I am here: ' controller y action b if !item.save

[Rails] Meaning of %%

2009-01-18 Thread James Englert
What does this syntax in an erb file 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

[Rails] Re: how to keep track of popular items

2009-01-11 Thread James Englert
You could just keep it in memory if accuracy isn't very important. On Sun, Jan 11, 2009 at 7:00 PM, Mohammad Abed rails-mailing-l...@andreas-s.net wrote: I have a site which is basically a catalog of product about 30,000.00 products. What do you think is the best (in terms of performance)

[Rails] Determining whether yields have content

2009-01-04 Thread James Englert
Hey All, I would like some logic that would help me determine whether a yield has any content to it. For example: div class=submenu %= yield :submenu % /div I only want to display the div around the yield if the yield will have content. Any ideas? Thanks, Jim

[Rails] Retrieving multiple types with Ferret

2009-01-01 Thread James Englert
Hey, I want to store multiple different types of items in Ferret. I can store them all fine but retrieval seems troublesome. When i get items of multiple types back in a result set, how can I figure out what type they are and process accordingly. Does Ferret have some way to retrieve the

[Rails] Re: Preventing a form from submitting on ENTER

2008-12-29 Thread James Englert
I believe if you put a textarea in your form, the browser will not submit the form if you hit the enter key. It depends on which browser you are using though. On Mon, Dec 29, 2008 at 11:18 AM, Robert Walker rails-mailing-l...@andreas-s.net wrote: Ivor Paul wrote: How about removing form

[Rails] Re: How to get one columns as an array from database

2008-12-25 Thread James Englert
Maybe this is a bit off topic... I never knew you could use syntax like Project.all. When was this added to the language/framework? On Thu, Dec 25, 2008 at 9:28 PM, Gabriel Laskar bibi.s...@gmail.com wrote: On Fri, Dec 26, 2008 at 3:00 AM, Zhao Yi rails-mailing-l...@andreas-s.net wrote:

[Rails] Re: What's the maximum storage size of a Session ?

2008-12-21 Thread James Englert
Although I have idea, I would guess that you can store as much in rails session as you want. Your server probably won't like you much though. On Sun, Dec 21, 2008 at 7:07 PM, Tom Ha rails-mailing-l...@andreas-s.netwrote: Hi there, does anyone know (for sure) how much data we can technically

[Rails] Re: Rails Hosting

2008-12-09 Thread James Englert
I've had good luck with hostingrails.com On Tue, Dec 9, 2008 at 1:20 AM, Abhishek shukla [EMAIL PROTECTED]wrote: Hello Friends, Can you please help in finding a good rails hosting site. who can give a good technical support. Thanks Abhishek

[Rails] Re: Rails noob confusion - HTML Form Post to Rails Controller?

2008-12-09 Thread James Englert
Its allowed. I think you may need to use something like the following: protect_from_forgery :only = [:create, ...] Hope that helps. On Mon, Dec 8, 2008 at 9:46 PM, Jferg [EMAIL PROTECTED] wrote: I have recently been learning and trying to develop some application parts using Rails. One

[Rails] Re: Rails on shared hosting

2008-12-01 Thread James Englert
Rails would need to be installed. Do you have an .htaccess file that resides in your public_html directory? If so, that file is crucial for getting your app up and running. On Mon, Dec 1, 2008 at 7:46 PM, Nellboy [EMAIL PROTECTED] wrote: As far as I know (and that's not much in this case),

[Rails] Re: Books recommendation

2008-11-29 Thread James Englert
I would agree that the The Rails Way is decent. It can be a bit hard to find specific information though. Hope That Helps, Jim http://jim-rants.com/coding-blog/ On Sat, Nov 29, 2008 at 9:37 AM, Rob Lacey [EMAIL PROTECTED]wrote: I'd recommend these two for getting up and running. The Rails

[Rails] Re: how to redirect_to the index.html page

2008-11-29 Thread James Englert
Try redirect_to 'index.html' Jim Englert http://jim-rants.com/coding-blog/ On Sat, Nov 29, 2008 at 11:24 AM, Pepe Sanchez [EMAIL PROTECTED] wrote: hi all If I add in my code redirect_to :action = 'index' it redicrects to the index method in the current controller. how can I redirect

[Rails] Retrieving requester IP

2008-11-29 Thread James Englert
Hey All, How can you access the requesting computer's IP address? Thanks, Jim Englert --~--~-~--~~~---~--~~ 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: Passing form information

2008-11-26 Thread James Englert
Try session[:firstname] = firstname; Hope that helps. http://www.jim-rants.com/coding-blog/ On Wed, Nov 26, 2008 at 11:04 AM, Sean McGilvray [EMAIL PROTECTED]wrote: Hello everyone I am new to RoR and I was wanting to know how to pass form information (first_name, last_name, phone_number,

[Rails] Getting the number of years between two dates

2008-11-20 Thread James Englert
Hey, I need to get the number of years (as a number) between two dates. Here is what I have as a helper. # Returns the number of years between now and the specified date. def years_ago(date) dateDifference = DateTime.now - date results =Date.day_fraction_to_time(dateDifference)

[Rails] Re: Sending a fireforget http request in a model class.

2008-11-19 Thread James Englert
Hey, I would check this out: http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/index.html Syntax looks something like: http = Net::HTTP.new(www.google.com) headers, body = http.get() Hope that help Jim Englert http://www.jim-rants.com/coding-blog/ On Wed, Nov 19, 2008 at 9:36 AM,

[Rails] Re: Overriding layout causes empty response with content_for

2008-11-19 Thread James Englert
I would try to explicitly specify the layout for the other actions. If you read the docs, you can sort of infer that no layout will be applied if you explicitly apply a layout to some actions: http://api.rubyonrails.org/classes/ActionController/Layout/ClassMethods.html This will assign