Re: [Rails] Re: can rails be more friendly to windows user?

2015-05-20 Thread Brian Hogan
I teach Rails and have done so for nearly 8 years in workshops and classroom settings. The way to do this on Windows is to use RailsInstaller. http://railsinstaller.org/en It sets up everything you need, including Git and SSH keys. It supports Ruby 2.1 and Rails 4.1, but upgrading to Rails 4.2 is

Re: [Rails] activerecord adapter for msaccess mdb files

2010-11-11 Thread Brian Hogan
Adapters are actual ActiveRecord adapters. There's no msaccess adapter available, although there is a SqlServer adapter. If you can get the connection going through ODBC, you could probably write your own msaccess adapter - they're not that hard to write and you could use the sqlite3 adapter as a

[Rails] Re: RESTful design

2009-10-01 Thread Brian Hogan
No, it doesn't necessarily need more actions. Changing the product's price? that's an update Changing its on-hand quantity? That's an update Changing it's availability? That's an update. You may opt to have two controllers for your products... one for the public pages where the products are

[Rails] Re: Any way to avoid instantiating a class twice?

2009-10-01 Thread Brian Hogan
Persist that information to some other storage engine on your server, per user. The database is the first place I'd think of. Using database sessions removes the session limit. However, look into Memcached, MongoDB, CouchDB, and other options. They're pretty cool. Also, maybe have someone else

[Rails] Re: Report in DOC/Word

2009-09-29 Thread Brian Hogan
It can sorta be done but you will need a Windows server running with Office installed on it. You'll then host part of the app there, use some mechanism to trigger the word doc build on that machine. You use Win32OLE Ruby libraries to make Word do your bidding.

[Rails] Re: Report in DOC/Word

2009-09-29 Thread Brian Hogan
The real reason is that Ruby is open-source, mostly volunteer, and most people who make things in Ruby don't tend to use Windows. For example, I am probably capable of writing something that would pass, but I've got other things to do and none of my clients are paying me to write a Word export.

[Rails] Re: Keeping failed validations on the /new URL

2009-09-29 Thread Brian Hogan
That's just not how Rails works. Your form posted to the Create action, which is /object (and probably more likely objects/) and if you redirect you lose the errors. You should ask yourself Why does the URL matter? Your users will be focused on filling in the correct info, not the URL. Make your

[Rails] Re: Rails VS. .Net MVC

2009-04-03 Thread Brian Hogan
I guess the case I'd make for it is that your company should have been using MVC all along. While Rails is an MVC framework, there are multiple benefits to using Rails besides three letters. Substruct, Castle, and others have been available but none of your managers have been that interested in

[Rails] Re: auto_complete and Prototype 1.6.0.3

2009-03-24 Thread Brian Hogan
I guess it depends on how you have it coded. Some of the autocomplete stuff was moved out into a plugin which may not be maintained anymore. On Tue, Mar 24, 2009 at 12:32 PM, Jon Garvin jgarvin.li...@gmail.com wrote: We've got a site running on Rails 2.2.2 with Prototype 1.6.0.3 that uses

[Rails] Re: Help! RubyGems is broken!

2009-03-18 Thread Brian Hogan
remove the rubyopt thing from your profile. I have seen that cause this exact error on many systems. Of course, restart your terminal session after changing your profile. :) On Wed, Mar 18, 2009 at 11:58 PM, Richard richard.macks...@gmail.com wrote: Could you not try re-installing ruby gems??

[Rails] Re: rails, passenger, and images

2009-03-14 Thread Brian Hogan
@Steve: Awesome! On Sat, Mar 14, 2009 at 9:14 AM, Steve Odom steve.o...@gmail.com wrote: Well, how bout that. It was the facebooker plugin taking control of asset_host. Only appears to be a problem while running passenger. Thanks for the pointer Brian. Steve On Mar 13, 4:00 pm, Brian

[Rails] Re: Making the 'Back' link look the same as form.submit Sa

2009-03-13 Thread Brian Hogan
, Robert Walker rails-mailing-l...@andreas-s.net wrote: Brian Hogan wrote: I have found that the best solution to this problem is to use an image button for the submit button, and then use css to apply the same image to the back link. It's accessible and requires no javascript. That's not a bad

[Rails] Re: rails, passenger, and images

2009-03-13 Thread Brian Hogan
Check your app's source. Look for anything dealing with asset_host. My guess is something is prepending this to your image helper, and asset_host will do that if you tell it to. If you create a new Rails app, you'll be able to test this out by making a controller and a view. On the view, just

[Rails] Re: InvalidAuthenticityToken from home page

2009-03-12 Thread Brian Hogan
@seja: Yeah but that's for the entire app, and it's not a good idea to disable it for the entire ap. On Thu, Mar 12, 2009 at 2:35 AM, seja sej...@gmail.com wrote: you also can set forgery protection to false In rails 2, it is true by default. Set in environment file

[Rails] Re: What's the latest on WYSIWYG editor integration with Rails?

2009-03-12 Thread Brian Hogan
That's for markdown, not HTML, and it's not what you see is what you get. It's just a nice toolbar. neat though. I may use this on something else. Thanks for sharing! On Thu, Mar 12, 2009 at 1:56 PM, Lee Smith rails-mailing-l...@andreas-s.net wrote: Livepipe has a textarea control built on top

[Rails] Re: Help: rails magic fallout

2009-03-12 Thread Brian Hogan
@Simon: Hey, namespace collisions can be troubling, but I'm confused. You said you made a method on a non-activerecord model but then you said it worked once you removed the db definition. What was the name of your model, and did you define a class method or an instance method? Did you have

[Rails] Re: Monkey Patching a Plugin

2009-03-11 Thread Brian Hogan
I agree with this. Submit the patch. If he says no, fork the plugin yourself on github and maintain it. :) On Wed, Mar 11, 2009 at 6:50 PM, Phlip phlip2...@gmail.com wrote: Daly wrote: I am using a plugin that adds a method to ActiveRecord::Base. The added method is called

[Rails] Re: unit test model validations

2009-03-11 Thread Brian Hogan
Michael: In October, I gave a quick intro to Rails with test-driven development at a local code camp. I distributed a PDF to the group that walks a newcomer through test-first development. Perhaps it would help you get a handle on how to get started. This link contains a link to the PDF as

[Rails] Re: InvalidAuthenticityToken from home page

2009-03-11 Thread Brian Hogan
@Paul: You need to disable forgery protection on the login action in order to use a static home page. Assuming your login is processed by restful_authentication's sessions_controller.rb, add this to that class: protect_from_forgery, :except = [:create] That's it. If that's unacceptable to

[Rails] Re: Search Function

2009-03-11 Thread Brian Hogan
In general, a many-to-many relationship involves three tables. Can you describe how you've done this relationship with Rails? Did you use a has_and_belongs_to_many with a categories_stories table? Or did you use a has_many :through association with a different through table? On Wed, Mar 11,

[Rails] Re: What's the latest on WYSIWYG editor integration with Rails?

2009-03-11 Thread Brian Hogan
Everyone I know is still using fckeditor modded to do file uploading and stuff. I personally haven't found anything better but I'd love to know if there is. On Wed, Mar 11, 2009 at 4:24 PM, Philip Hallstrom phi...@pjkh.com wrote: Hi all - For awhile now I've been using Fckeditor (and it's

[Rails] Re: Making the 'Back' link look the same as form.submit Sav

2009-03-11 Thread Brian Hogan
I have found that the best solution to this problem is to use an image button for the submit button, and then use css to apply the same image to the back link. It's accessible and requires no javascript. --~--~-~--~~~---~--~~ You received this message because you

[Rails] Re: Getting started, sort of

2009-03-10 Thread Brian Hogan
Hey, I wrote that :) Should have just sent me an email directly, I'd have helped you get it working. I'll update the cookbook to reflect that issue. Thanks for reminding me. On Thu, Feb 26, 2009 at 10:50 PM, bachcole rogerbi...@msn.com wrote: I fixed the problem with Eric's original post.  

[Rails] Re: Question about testing

2009-02-04 Thread Brian Hogan
No. Fixtures are fixed. Do this: original_homework = homeworks(:one) xhr :get, :status, :id = original_homework.id, :status = done changed_homework = assigns(:homework) # get it from the controller's instance # now compare original_homework and changed_homework. I don't know what you're

[Rails] Re: User Permalink in Rails ???

2009-01-27 Thread Brian Hogan
, :action = show At the bottom of your routes.rb file. - Ryan Bigg On 27/01/2009, at 1:07 PM, Louis-Pierre Dahito wrote: Brian Hogan wrote: LOL There's no reason to use to_param. It's just a convention to pass the id through the URL. It's type is not enforced. # expects /users

[Rails] Re: User Permalink in Rails ???

2009-01-26 Thread Brian Hogan
LOL There's no reason to use to_param. It's just a convention to pass the id through the URL. It's type is not enforced. # expects /users/15 def edit @user = User.find(params[:id]) end # expects /users/bphogan def show @user = User.find_by_username(params[:id]) end The only thing to watch

[Rails] Re: Shared templates across controllers

2009-01-20 Thread Brian Hogan
I can think of a few things off the top of my head - one way is to have one RJS file that looks like this: page.visual_effect :toggle_slide, hidden...@object}_form page.visual_effect :toggle_slide, add...@object}_testimonial}_button And in each controller action, right before rendering the

[Rails] Re: functional testing with restful_authentication

2009-01-20 Thread Brian Hogan
You could skip passing it and do it directly. In your functional test, declare a setup method that gets run before everything else. Load fixutres and use Quentin (first fixture) and add his ID to the session directly. fixtures :all def setup @request.session[:current_user] =

[Rails] Re: Shared templates across controllers

2009-01-20 Thread Brian Hogan
if there's a better way. -Adam On Jan 20, 2:03 pm, Brian Hogan bpho...@gmail.com wrote: I can think of a few things off the top of my head - one way is to have one RJS file that looks like this: page.visual_effect :toggle_slide, hidden...@object}_form page.visual_effect :toggle_slide, add

[Rails] Re: How can I specify layout when using redirect_to

2009-01-20 Thread Brian Hogan
You don't. Layouts are associated with the controller, or the controller's action render :layout = admin If you want to change it, the better approach would be to do something like before_filter :login_required before_filter :choose_layout def index render :layout = @layout end private

[Rails] Re: functional testing with restful_authentication

2009-01-20 Thread Brian Hogan
this anyway. Changing the id in the session has no effect as the user is already logged in. 2009/1/20 Brian Hogan bpho...@gmail.com You could skip passing it and do it directly. In your functional test, declare a setup method that gets run before everything else. Load fixutres and use

[Rails] Re: should I use the validation framework (e.g. add_to_base) to pass back multiple data errors that are identified???

2009-01-20 Thread Brian Hogan
I don't necessarily see what's wrong with add_to_base. Seems somewhat logical to me but I don't really know what you're attempting to do :) On Tue, Jan 20, 2009 at 7:09 PM, Greg Hauptmann greg.hauptmann.r...@gmail.com wrote: (bump) On Tue, Jan 20, 2009 at 5:00 PM, Greg Hauptmann

[Rails] Re: should I use the validation framework (e.g. add_to_base) to pass back multiple data errors that are identified???

2009-01-20 Thread Brian Hogan
and passing to a view and displaying? hope this makes sense in terms of clarifying my Rails best practice question. On Wed, Jan 21, 2009 at 11:32 AM, Brian Hogan bpho...@gmail.com wrote: I don't necessarily see what's wrong with add_to_base. Seems somewhat logical to me but I don't really know

[Rails] Re: Utter Newbie, HELP!!!!

2009-01-14 Thread Brian Hogan
Ruby on windows works fine. The package you have there works fine for general web development with Rails. However you've got a lot of things oyu have to learn in order to be able to build a blog in 10 minutes. I have a couple of resources you might find useful though: First, I maintain a simple

[Rails] Re: Problems with SQL Server 2008 and migrations using activerecord-odbc-adapter gem

2009-01-12 Thread Brian Hogan
That's really good to know and it makes sense. To verify, this is with the activerecord-odbc-adapter, correct? On Mon, Jan 12, 2009 at 7:39 AM, Ben benpe...@freenet.co.uk wrote: Ok. After further investigation it turns out there isn't a problem with the adapter, apart from lack of obvious

[Rails] Re: Passing information to the controller from view

2009-01-08 Thread Brian Hogan
bphogan at gmail dot com On Thu, Jan 8, 2009 at 8:47 AM, Ryan Mckenzie rails-mailing-l...@andreas-s.net wrote: Brian Hogan wrote: In your controller, you just need data = render_to_string({:action = 'create.html.erb', :layout=false}) I'm doing a PDF (using HTMLDOC) that way. Works

[Rails] Re: Problems with SQL Server 2008 and migrations using activerecord-odbc-adapter gem

2009-01-08 Thread Brian Hogan
It shouldn't be hard to remove that restriction from the code :) I wonder what would happen? I don't have sql2k8 around but I'd love to hack on it. On Thu, Jan 8, 2009 at 10:41 AM, Ben benpe...@freenet.co.uk wrote: Once I figured out how to use it, it usefully tells you its only supported for

[Rails] Re: Problems with SQL Server 2008 and migrations using activerecord-odbc-adapter gem

2009-01-07 Thread Brian Hogan
Have you tried using this instead? http://github.com/rails-sqlserver/2000-2005-adapter/tree/master We don't use the activerecord-odbc adapter for our apps. We also install ruby-odbc and ruby dbi from source rather than from gems, but I hear that gems work fine $ gem install dbi --version

[Rails] Re: Passing information to the controller from view

2009-01-07 Thread Brian Hogan
In your controller, you just need data = render_to_string({:action = 'create.html.erb', :layout=false}) I'm doing a PDF (using HTMLDOC) that way. Works awesome. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[Rails] Re: Why isn't there a :dependent = false option?

2008-12-16 Thread Brian Hogan
@Ed: Just leave the :dependent option off completely and nothing happens to the other records. That's the default behavior. On Tue, Dec 16, 2008 at 10:37 AM, Patrick Doyle wpds...@gmail.com wrote: On Tue, Dec 16, 2008 at 10:29 AM, Ed Lebert edleb...@gmail.com wrote: I have an audit table

[Rails] Re: Where do I start?

2008-12-12 Thread Brian Hogan
I learned Rails first and got into Ruby because of it. If you have programmed before, I don't think you need to know Ruby to do anything simple with Rails, but you do need Ruby do anything substantial. Agile Web Development with Rails really doesn't require much prior Ruby knowledge to get a feel

[Rails] Re: mysql.rb driver has been removed from Rails 2.2 ?

2008-12-11 Thread Brian Hogan
You get around this by actually installing the MySQL gem with C bindings. The one you guys are talking about is the pure Ruby one. The pure-MySQL library is terrible for performance and can cause some seriously flaky stuff. There are a number of posts on tis list that discuss the installation

[Rails] Re: Restless Rails

2008-12-08 Thread Brian Hogan
Exactly, but you can be a little smarter about it. When you do update_attributes, it's gonna take whatever you pass it. A lot of sites put the change your password field on the same page as the other profile stuff but they make it a separate form submit, so the password fields are the only

[Rails] Re: Can I export db data to fixtures?

2008-12-01 Thread Brian Hogan
Yeah there are a few plugins to do that. There's one called ar_fixtures that should work just fine. I don't know if it's supported any more but I know it still works fine. On Mon, Dec 1, 2008 at 8:14 PM, Arthur Chan [EMAIL PROTECTED] wrote: Hi Guys, Is there any way to export db data to

[Rails] Re: The verdict on Rails scaffolding

2008-11-30 Thread Brian Hogan
Meh, I'll teach you RSpec if you want, but I''m a bigger fan of test::unit. Find me on IRC - hoganbp On Sun, Nov 30, 2008 at 10:06 AM, Bobnation [EMAIL PROTECTED] wrote: On Nov 30, 9:18 am, Robert Walker [EMAIL PROTECTED] wrote: One thing I discovered about scaffolding, even as a starting

[Rails] Re: The verdict on Rails scaffolding

2008-11-30 Thread Brian Hogan
Ralph: It works fine. I just stole the generation code from Rails 1.2.3 but it works fine in Rails 2.x - I have a few things I might want to change as it goes forward, but I keep my stuff in pretty good shape - if it's deprecated I'll push a final release that says so in the readme :) I'm

[Rails] Re: How could I uninstall the build-in gems in Leopard

2008-11-17 Thread Brian Hogan
On our setups, we simply use the built-in mac stuff and then update the old versions. gem update --system gem install rails You can safely ignore the old versions without a problem. On Mon, Nov 17, 2008 at 4:04 AM, Frederick Cheung [EMAIL PROTECTED] wrote: On Nov 17, 8:46 am, [EMAIL

[Rails] Re: Restless Rails

2008-11-16 Thread Brian Hogan
Yup. This is *exactly* why you can do map.resources :apartments, :collection = {:update_all = :put} Like every convention, there are problems, and there are solutions to that problem. Think about ActiveRecord. There are a few edge cases where the conventions just break down. But just because

[Rails] Re: Restless Rails

2008-11-14 Thread Brian Hogan
Guys: I spent about a year fighting RESTful design in Rails for the reasons you've outlined. I don't like things that are cool most of the time. I like things that work. However, the more things I've done with RESTful design, the more I truly appreciate it. The thing is that people can explain

[Rails] REST API authentication strategies when using OpenID

2008-11-13 Thread Brian Hogan
What sort of mechanisms are people using to expose their APIs to people if they use OpenID? On a recent project, I just generated an email + api key pair for each account and I tell people to use that, then my authentication system looks for that in lieu of openID credentials. I'd really be

[Rails] Re: Touch an ActiveRecord - timestamps

2008-11-13 Thread Brian Hogan
I recommend an observer to do this, and I also recommend using a different column other than updated_at. I use last_modified_at to store the date that any part was changed, and reserve updated_at for tracking when the individual pieces are changed. Something like this would work, although this

[Rails] Re: Easiest RoR - PDF solution (based on HTML and CSS)

2008-10-31 Thread Brian Hogan
I use HTMLdoc on www.feelmyskills.com and it works quite well. Ridiculously easy to implement and you get to use HTML. On Fri, Oct 31, 2008 at 11:24 AM, Borja Martín [EMAIL PROTECTED] wrote: If you don't mind using java, you can use the flying saucer library in an external application and

[Rails] Re: mac vs windows - why is windows soooo slow?

2008-10-17 Thread Brian Hogan
I'm the one who went on record in Deploying Rails Applications. Rails isn't slow on Windows - Ruby is. It was horribly slow almost four years ago when I started, and it's slow now, although it's faster because our CPUs have gotten faster. I spent a good majority of my Rails career working on the

[Rails] Re: RESTful question

2008-10-16 Thread Brian Hogan
Oooh... I'm gonna throw my own spin on this and say tha it should not be a create... but instead a retrieve. While it's true you might be creating a new dump, you actually want to GET the configuration from the system. Just like when you request a resource that might be XML,. you don't create a

[Rails] Re: stray questions

2008-10-14 Thread Brian Hogan
See inline - I'll do my best to answer. On Tue, Oct 14, 2008 at 4:08 PM, Peter Krause [EMAIL PROTECTED] wrote: Hi, I've been googling and going through the forum, and I can't find the answers so some stray questions. A) If I have a render :partial is there a way to get rid of the

[Rails] Re: Use a string as template for mail body

2008-10-14 Thread Brian Hogan
While this is pretty easy with the ERB library and its rendering, it's also very dangerous. You'll need to build a whitelist of what you'll let them do. Hello #{User.delete_all} Never let anyone arbitrarily monkey with your code or data. Instead, make your own parser or look at how some of the