[Rails] Does rake db:schema:load need the whole environment?

2013-10-28 Thread brianp
I ran into a "chicken before the egg" problem where a gem was expecting the tables to be present when loaded which was fine until you try and build the db from scratch using db:setup. When it hits db:schema:load the environment loads and the gem errors out as the tables aren't present. I made a

[Rails] Cucumber & RSpec with Autotest

2010-07-09 Thread brianp
Hey, Having an issue getting RSpec to work with Cucumber and autotest. If I run $ autotest just the rails tests run. If I run $ AUTOFEATURE=true autotest features and rails tests are run. If I run $ AUTOFEATURE=true autospec Only specs are run. If I run $ AUTOFEATURE=true RSPEC=true autotest Only

[Rails] Cumber: Sending unwanted form parameters

2010-06-18 Thread brianp
Image model. "Data file name must be set." But I'm not submitting an image so the Image model should never be called. Why is cucumber sending data that's getting to the nested attributes in vehicle? Cheers, brianp -- You received this message because you are subscribed to th

[Rails] New Project > Rails 2 or 3 ?

2010-05-28 Thread brianp
Hey, Working on a project for a new startup. We started it in Rails 2.3.5. but now the project manager is talking about wanting to switch to Rails 3 because it's the hot new thing. Whats the consensus if rails is ready for production environments that the customers will depend on? I haven't looke

[Rails] Re: ActionMailer + Gmail = Timeout::Error

2010-05-26 Thread brianp
5:44 pm, kannav rajeev wrote: > hi brain i just cofig this one for my app . > please check out >   app/models/users_application. > > > > > rb:108:in `mail_app!' > > and if possible plugin use action_mailer_tls that works for me thanks > > > > On Thu,

[Rails] ActionMailer + Gmail = Timeout::Error

2010-05-26 Thread brianp
e, :user_name => "my_em...@gmail.com", :password => "secret" } Cheers, brianp -- 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...@go

[Rails] Re: accepts nest attributes & attr_accessible

2010-05-19 Thread brianp
issue because it would still be in context. how would this look in the controller? @dealer.users.find(3).update_attributes(params[:update_user_form]) ? Thanks, brianp On May 19, 9:48 am, Sharagoz wrote: > This is not a problem if you are always creating users in context of > dealers and validati

[Rails] Re: Self Creating edit page?

2010-05-19 Thread brianp
Yes I have that's how I know it's changing the form method to PUT to dealer/id/edit. It's also adding an id of: edit_dealer_id_{#number} where {#number} is an actual digit. On May 19, 9:38 am, Colin Law wrote: > On 19 May 2010 16:44, brianp wrote: > > > Expecting to

[Rails] Re: accepts nest attributes & attr_accessible

2010-05-19 Thread brianp
he foreign keys > doesn't work together. My question is: Why are you putting > attr_protected on the foreign_keys? To prevent users from being able > to move a child to a different parent when editing its attributes? If > so, I recommend you use attr_readonly instead. >

[Rails] Re: Self Creating edit page?

2010-05-19 Thread brianp
anged my hard coded input to post to the create action into a :put method to the :update action. I know it's kind of an obscure problem. Maybe later today I'll post a git repository with the code needed to recreate the problem. On May 19, 1:13 am, Sharagoz wrote: > On May 19, 2:36

[Rails] accepts nest attributes & attr_accessible

2010-05-18 Thread brianp
lt; ActiveRecord::Base has_many :persons has_many :children (childs?) attr_protected :id end cheers, brianp -- 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...@

[Rails] Self Creating edit page?

2010-05-18 Thread brianp
it just render the correct page like when the dealer params are incorrect. Something has gone horribly wrong somewhere and nothing is working like i'd expect. Any suggestions would help, cheers, brianp -- You received this message because you are subscribed to the Google Groups "Ruby

[Rails] validation on association create

2010-05-18 Thread brianp
<< Role.find(3) @user.save! @dealer.addresses.create(params[:mailing_address]) @dealer.addresses.create(params[:billing_address]) end cheers, brianp -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" gro

[Rails] Re: HABTM Blank Join table

2010-05-18 Thread brianp
Hey Sharagoz, Thanks a lot. It worked exactly as desired. Now I was lead to believe that the habtm relationship would be created automagically when the user object is created. Why is it we had to explicitly define it like this? Thanks a lot! -brianp On May 18, 5:48 am, Sharagoz wrote: > I d

[Rails] HABTM Blank Join table

2010-05-18 Thread brianp
e! @user = @dealer.users.create(params[:user].merge(:role_id => 3) @dealer.addresses.create(params[:mailing_address]) Every field is created without error except the join table is left blank always. If i call: @user.role.create it will successfully create a new role (with a blank name which is

[Rails] Re: Transaction Failures

2010-05-18 Thread brianp
Found my problem immediately after posting. In: rescue ActiveRecord::RecordInvalid => invalid flash[:notice] = "Vehicle was not created" @dealer = Dealer.new @user = User.new render :action => "new" end Should be: rescue ActiveRecord::RecordInvalid => invalid flash

[Rails] Transaction Failures

2010-05-18 Thread brianp
Hey, I've got a multiple model (4) form on my site. I have the controller handling the creation with a transaction. I do this because if one object can't save I don't want any of them saved and need to be able to quit the entire transaction without making any permanent db calls. The problem I fi

[Rails] Kaboodle Bookmarklet - Method?

2010-04-29 Thread brianp
Hey, I was just wondering if anyone had a more in depth concept on how the Kaboodle Bookmarklet works or how to mimic the concept. I know there would be some sore of page scraping. I've tried the Kaboodle bookmarklet on many different pages and not all pages have descriptive identifiers in the co

[Rails] Re: Inheritance

2010-03-30 Thread brianp
Thanks for your replies Yong Gu. I believe the article was exactly the information I was seeking. Cheers, brianp On Mar 30, 12:39 am, Yong Gu wrote: > I am sorry that i do not have too much ideas about whether STI(Single Table > Inheritance) are good or not, it depends. > > here is

[Rails] Re: Inheritance

2010-03-30 Thread brianp
nce > as feline, seeing_eye_dog will be left empty. > > On Tue, Mar 30, 2010 at 3:19 PM, brianp wrote: > > I've done some reading on Single Table Inheritance. > > > I think I need something a little more though. > > > Classic example. > > > cla

[Rails] Inheritance

2010-03-30 Thread brianp
I've done some reading on Single Table Inheritance. I think I need something a little more though. Classic example. class Animal < ActiveRecord::Base // db fields: name: string age: int type: string breed: string end class Feli

[Rails] Re: Join tables

2010-03-29 Thread brianp
for your replies. I hope it was just a momentary lapse on my behalf cause I know I knew that before lol. On Mar 29, 1:52 am, Colin Law wrote: > On 29 March 2010 09:32, brianp wrote: > > > Sorry I deleted my original post as I thought I had figured it out > > well talking ou

[Rails] Re: Join tables

2010-03-29 Thread brianp
the results then to just do it like mentioned above. On Mar 29, 1:07 am, Colin Law wrote: > On 29 March 2010 08:33, brianp wrote: > > > Just working out my db schema before I start development and I got > > stuck on my join tables. With the way most associations work i

[Rails] Join tables

2010-03-29 Thread brianp
Just working out my db schema before I start development and I got stuck on my join tables. With the way most associations work in rails already. Are join tables really needed? Rails will handle most of that auto magically so won't building and maintaining these tables in the application by hand be

[Rails] Admin Sections & Roles

2010-03-25 Thread brianp
to run two different logins with 2 different user tables? SiteWideAdmin and Dealers. Or one master login with one user table and allot of permissions & roles spread all over ? Cheers, brianp -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk

[Rails] Re: Upcoming app > Research and Prep

2010-03-24 Thread brianp
rful your server is. If you have 8 cores then you probably want more > mongrels than on a 4 core machine. You also need to take into account how > much RAM you have available to you. > > -- > Jeremy Chasehttp://twitter.com/jeremychase > > On Tue, Mar 23, 2010 at 4:58 PM, brianp

[Rails] Re: Upcoming app > Research and Prep

2010-03-24 Thread brianp
On Mar 24, 4:59 pm, Marc Byrd wrote: > Life may be much simpler for you when you scale if you use a nosql option, What nonsql option would you recommend? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send emai

[Rails] Re: Upcoming app > Research and Prep

2010-03-24 Thread brianp
I wish I had known about this place before I paid for my current hosting =S . Unfortunately I think I'll be staying with my current host until I see problems or at least start getting customers. As long as I keep scalability in ind through the whole process I should be okay. Prepping for multiple

[Rails] Re: Upcoming app > Research and Prep

2010-03-24 Thread brianp
is served from? On Mar 24, 1:58 pm, Matt Jones wrote: > On Mar 23, 4:58 pm, brianp wrote: > > > > > Hey everyone. > > > I'm a one person team and in the next month need to produce and deploy > > an application. I've been playing with rails for a little o

[Rails] Upcoming app > Research and Prep

2010-03-23 Thread brianp
Hey everyone. I'm a one person team and in the next month need to produce and deploy an application. I've been playing with rails for a little over a year now and recently deployed my first app as a private contract. I'm now planning development on a start up company. The app should be expecting

[Rails] Authlogic -> Production Server

2010-03-13 Thread brianp
Sorry if this is a repost. I never received a successful post msg. So this is my first deployment. I've used Capistrano and Git. CPanel to install all the gems (with some added server support for additional gems). CPanel is used to start/stop the app. In development mode the app starts and runs in

[Rails] Re: dynamic drop downs for product search [SOLVED]

2010-02-09 Thread brianp
it back to the partial. protected def change_selects(selectsToChange) render :update do |page| selectsToChange.each do |item| page.replace_html item[0].to_s+"Select", :partial => "vehicles/ makeSelect", :locals => { :list => item[1], :box => item[0

[Rails] Re: Same partial different results

2010-02-09 Thread brianp
ttle glitch I guess. I could understand if it didn't work at all lol. Thanks for the suggestion Colin! On Feb 9, 12:07 am, brianp wrote: > Hey Colin, > thanks for the reply. > > I did think to check for that and un-fortunately the html for the > prompt (first ) is not gener

[Rails] Re: Same partial different results

2010-02-09 Thread brianp
ary 2010 23:19,brianp wrote: > > > So it turns out it's not just the partial. Any dropdown select i ad to > > that page will not properly display :prompt. Now I have an ajax update > > method so If i change the select all selects are reloaded. And as soon > > as I

[Rails] Re: Same partial different results

2010-02-07 Thread brianp
So it turns out it's not just the partial. Any dropdown select i ad to that page will not properly display :prompt. Now I have an ajax update method so If i change the select all selects are reloaded. And as soon as I change one they all act accordingly with prompt displayed properly. So it seems

[Rails] Same partial different results

2010-02-06 Thread brianp
Hey everyone. I'm using a partial 3 times in my applications.html.erb file. When the index is loaded everything works exactly like it should. (the partial contains a collection_select with prompts). If i goto the show action the options for the collection select seem to vanish. IE no prompt when r

[Rails] passing multiple objects with remote_function

2010-01-30 Thread brianp
Hey, I can successfully pass a single object from any form field to my controller via: Select Year: <%= collection_select("vehicle", "year", @availableYears, "year", "year", {:prompt => "Select a year"}, {:onchange => "#{remote_function(:url => {:action

[Rails] dynamic drop downs for product search

2010-01-28 Thread brianp
Hey Everyone, I'm about to embark on having a search function for the products on my app via dynamic dropdowns. A dropdown for make would only leave AVAILABLE models of that make. selecting year would only leave available makes from that year etc etc. Any suggestions or good read ups ? -- You r

[Rails] Re: A more graceful friendly url method?

2010-01-27 Thread brianp
as in maybe I should write a helper that checks the data type and passed it to the find ? or returns the desired results... hmmm I suppose i do have some options. Thanks for the reply! On Jan 27, 9:26 am, Philip Hallstrom wrote: > On Jan 27, 2010, at 2:39 AM, brianp wrote: > > > >

[Rails] A more graceful friendly url method?

2010-01-27 Thread brianp
y something I'm missing / a more graceful way. Thanks, brianp -- 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 email

[Rails] Re: Calling a models function via a link

2010-01-27 Thread brianp
Thanks Jeffrey, I had a good feeling this is how it needed to be done. But felt like I was bloating my controller. Now I'm happy knowing I was originally going in the right direction. Thanks again. brianp On Jan 27, 2:10 am, "Jeffrey L. Taylor" wrote: > Quoting brianp : >

[Rails] Calling a models function via a link

2010-01-27 Thread brianp
t; as he comes across old inventory. Thanks, brianp -- 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 email to rubyonrail

[Rails] Re: imagemagic errors

2010-01-10 Thread brianp
ince just haven't had the time to inquire. On Jan 9, 11:40 pm, Conrad Taylor wrote: > On Sat, Jan 9, 2010 at 8:10 PM, brianp wrote: > > whiteone:~ brianp$ port -v > > MacPorts 1.8.2 > > > I did "sudo port selfupdate" > > I don't believe i "

[Rails] [SOLVED] Re: imagemagic errors

2010-01-10 Thread brianp
one's help, patience and suggestions! And I hope some day down the road this helps someone else out there. -brianp On Jan 9, 11:46 pm, Conrad Taylor wrote: > On Sat, Jan 9, 2010 at 9:09 PM, pharrington wrote: > > On Jan 9, 11:10 pm, brianp wrote: > > > whiteone:~ brianp

[Rails] Re: imagemagic errors

2010-01-09 Thread brianp
whiteone:~ brianp$ port -v MacPorts 1.8.2 I did "sudo port selfupdate" I don't believe i "sudo port sync" I did not upgrade to snow leopard (because it blew up my server) I'm running on Mac os 10.5.8 On Jan 9, 7:23 pm, Conrad Taylor wrote: > On Sat, Jan

[Rails] Re: imagemagic errors

2010-01-09 Thread brianp
So i tried: export MAGICK_HOME="/opt/local/" export PATH="$MAGICK_HOME/bin:$PATH" export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib" no success. So I tried re-installing imagemagick for a 4th(?) time so I could show you the input/output and now the re-install fails

[Rails] Re: imagemagic errors

2010-01-09 Thread brianp
ry file_column plugin of active scaffold to do file upload > its very good and easy to use. > > On Sat, Jan 9, 2010 at 12:02 PM, brianp wrote: > > Hey everyone, > > I'm still having a ton of image issues. > > > I had been using attachment_fu and ran into errors so i ch

[Rails] imagemagic errors

2010-01-08 Thread brianp
rts script: http://github.com/maddox/magick-installer/blob/master/magick-installer.sh I'm tried running "identify" on the command line brianp$ identify image.jpg -bash: identify: command not found So I'm assuming the problem is at the heart of the installation as it seems none of t

[Rails] Re: Can rails even gracefully upload?

2010-01-08 Thread brianp
hese at the command line and what should i do if they don't work? I re-installed via Mac Ports. thanks, bp On Jan 7, 5:09 am, PsiPro wrote: > brianp, > > Checkout these railscasts: > > http://railscasts.com/episodes/134-papercliphttp://railscasts.com/episodes/182-cropping-i

[Rails] Can rails even gracefully upload?

2010-01-04 Thread brianp
Sorry I really just wanted to have a title to catch attention. I've had no luck with attachment_fu. It almost works but I've failed at finding a solution to it's pitfalls. (http://groups.google.ca/group/rubyonrails-talk/browse_thread/thread/ 1101ec5b888b3020/a0418430e0b59f42?l

[Rails] [solved] Handling initial user setup (authlogic)

2009-12-29 Thread brianp
from your migration files. And a distinct place to do it instead of assorted rake files. Thankis, for your reply I wouldn't have found it had i not started to search for rake tasks. On Dec 28, 6:43 am, Leonardo Mateo wrote: > On Mon, Dec 28, 2009 at 6:59 AM, brianp wrote: > > Hey,

[Rails] problems with thumbnails, attachment_fu

2009-12-29 Thread brianp
Hey, I've had this problem for about 2 months and never solved it. Image model: has_attachment :content_type => :image, :max_size => 7.megabytes, :resize_to=> '1000x100>', :storage => :file_system, :thumbnails => {

[Rails] Handling initial user setup (authlogic)

2009-12-28 Thread brianp
Hey, I was just wondering what you do to handle the initial user setup with a project using authlogic. I'm still in development but what i find annoying is the create new users function is obviously kept in the admin section. I can't get into the admin section without a user... You see the problem

[Rails] Simple string comparasons

2009-12-24 Thread brianp
d if theres content display it. Otherwise skip that whole field ? I figure it should be pretty easy but everything I try fails. Thanks, Happy Holidays ! brianp -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this grou

[Rails] [Solved] Re: Ajax.Updater & Only get, put, and delete requests are allowed.

2009-11-26 Thread brianp
ad the entire page layout inside the container =) On Nov 26, 11:26 am, brianp wrote: > And for anyone following this thread with the same problem, by > method:'delete' i mean method:'get' lol I copy & pasted from an > example. > > On Nov 26, 10:28 

[Rails] Re: Ajax.Updater & Only get, put, and delete requests are allowed.

2009-11-26 Thread brianp
And for anyone following this thread with the same problem, by method:'delete' i mean method:'get' lol I copy & pasted from an example. On Nov 26, 10:28 am, "Jeffrey L. Taylor" wrote: > Brian, >   Sounds good. > > Jeffrey > > Quoting brianp

[Rails] Re: Ajax.Updater & Only get, put, and delete requests are allowed.

2009-11-26 Thread brianp
gt; new action is a GET that returns the form for a new object.  The create action > expects a POST with the data for the new object.  If this is not the semantics > of your app or controller, either don't use 'map.resources' which does conform > to the Rails/RESTful way

[Rails] Re: Ajax.Updater & Only get, put, and delete requests are allowed.

2009-11-26 Thread brianp
w to run. On Nov 26, 12:57 am, "Jeffrey L. Taylor" wrote: > Quoting brianp : > > > Hey everyone, > > > I'm using the Ajax tabs method/example seen > > at:http://actsasflinn.com/Ajax_Tabs/index.html > > > It renders partials without a problem

[Rails] Ajax.Updater & Only get, put, and delete requests are allowed.

2009-11-26 Thread brianp
Hey everyone, I'm using the Ajax tabs method/example seen at: http://actsasflinn.com/Ajax_Tabs/index.html It renders partials without a problem but when I need it to render from :controller => 'manage', :action => 'new' I receive: ActionController::MethodNotAllowed Only get, put, and delete req

[Rails] Ajax.Updater & Only get, put, and delete requests are allowed.

2009-11-26 Thread brianp
Hey everyone, I'm using the Ajax tabs method/example seen at: http://actsasflinn.com/Ajax_Tabs/index.html It renders partials without a problem but when I need it to render from :controller => 'manage', :action => 'new' I receive: ActionController::MethodNotAllowed Only get, put, and delete req

[Rails] Re: Common variable.

2009-11-16 Thread brianp
gt;       end > > Darian Shimy > --http://www.darianshimy.comhttp://twitter.com/dshimy > > On Mon, Nov 16, 2009 at 10:49 PM, brianp wrote: > > > Hey Everyone, > > > At the bottom of my site layout I have a suggested item box. This box > > is at the bottom

[Rails] Common variable.

2009-11-16 Thread brianp
Hey Everyone, At the bottom of my site layout I have a suggested item box. This box is at the bottom of everypage but the admin/manage section. I tried using: class ApplicationController < ActionController::Base @mightlike = Vehicle.random end then in the view for vehicles: // vehicles.ht

[Rails] attachment_fu :thumbnail counter-acting :resize_to

2009-10-21 Thread brianp
Hey everyone, In my model i have: has_attachment :storage => :file_system, :content_type => :image, :max_size => 7.megabytes, :resize_to => '1000x1000>', :thumbnails => { :thumb=>'150x100>' } But what I end up with is two

[Rails] attachment_fu :thumbnail counter-acting :resize_to

2009-10-21 Thread brianp
Hey everyone, In my model i have: has_attachment :storage => :file_system, :content_type => :image, :max_size => 7.megabytes, :resize_to => '1000x1000>', :thumbnails => { :thumb=>'150x100>' } But what I end up with is two

[Rails] Re: App best practice > Client Credit Information

2009-09-28 Thread brianp
backing out. For both my own and my clients benefit. I just want to make sure I can get a full picture before I pull out/go ahead. thanks, brianp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rail

[Rails] Re: App best practice > Client Credit Information

2009-09-27 Thread brianp
e guidelines it should be okay? thanks, brian On Sep 27, 7:03 pm, Marnen Laibow-Koser wrote: > brianp wrote: > > Well that was the question. Whats the best way to go about this. If > > it's more secure to just get the information to the recipient by email > > then so be

[Rails] Re: App best practice > Client Credit Information

2009-09-27 Thread brianp
at is. On Sep 27, 6:01 pm, Eric wrote: > Did I read you correctly in that you want to store user credit-card > numbers in your database for some period of time? > > -eric > > On Sep 27, 3:50 pm, brianp wrote: > > > Hey Everyone, > > > I'm in the process of l

[Rails] App best practice > Client Credit Information

2009-09-27 Thread brianp
Hey Everyone, I'm in the process of laying out a new app for a client. They need to be able to receive customers credit information (for a credit check done manually) via the website. So I have a few questions regarding the information. First I know I'll want to have a secure connection to tran

[Rails] Favorite Testing Frameworks

2009-09-14 Thread brianp
Hey everyone, With my recent run in with fixtures in the testing suite I was looking into others. >From what I can gather the all start line up is: rspec -> model and controller testing cucumber w/ webrat - > integration / view testing machinist w/ sham -> integration rails built in model testi

[Rails] Re: Route not generated, what have I missed? ** Solved **

2009-09-10 Thread brianp
uting guide to understand more about routes, and how to > add new actions:http://guides.rubyonrails.org/routing.html > > Thanks, > Abhinav > -- > अभिनवhttp://twitter.com/abhinav > > On Thu, Sep 10, 2009 at 2:05 PM, brianp wrote: > > > Brilliant! > >

[Rails] Re: Route not generated, what have I missed?

2009-09-10 Thread brianp
t sufficient. You > need to pass word id as well. > > See rake routes for all the paths/url generated and ids they need. > > Thanks, > Abhinav > > -- > अभिनवhttp://twitter.com/abhinav > > On Thu, Sep 10, 2009 at 12:48 PM, brianp wrote: > > > Hey Gu

[Rails] Route not generated, what have I missed?

2009-09-10 Thread brianp
Hey Guys, I'm basing this off of the book Simply Rails 2 by Patrick Lenz. I've got my word model: # word.rb has_many :votes my vote mode; # vote.rb belongs_to :word, :counter_cache => true my routes # routes.rb map.resources :words, :has_many => :votes Then my problem. In my view I'm trying t

[Rails] Re: Best Practice: Delete Method

2009-09-05 Thread brianp
quot;new" end respond_to do |format| format.html { redirect_to(words_url) } end end Which seems much more appropriate. On Sep 5, 1:07 pm, brianp wrote: > Your are very right. I shouldn't actually have the controller changing > the status at all. I should mayb

[Rails] Re: Best Practice: Delete Method

2009-09-05 Thread brianp
g dry like I thought of before. I should have thought of that earlier once i realized destroy was doing a little more work then actually destroying. Thanks for the input, I knew I was looking at it from the wrong angle it just felt wrong. On Sep 5, 12:25 pm, pharrington wrote: > On Sep 5, 3:07 pm

[Rails] Best Practice: Delete Method

2009-09-05 Thread brianp
Hey, I was just wondering what the best practice for this situation would be. I've got two models(word, definition) both with destroy methods in the controllers that just change the model.status to "deleted". In the words controller I'd like it to call the definition_controller destroy method on d

[Rails] Re: Function Testing Reloading Fixtures before assertion *Solved*

2009-09-03 Thread brianp
Nilesh, using: assert_equal :published, words(:one).status delete :destroy, :id => words(:one).to_param word_status = Word.find(:id).status assert_equal :deleted, word_status still returns // ActiveRecord::RecordNotFound: Couldn't find Word with ID=id Fred, I see what you mea

[Rails] Re: Function Testing Reloading Fixtures before assertion *Solved*

2009-09-03 Thread brianp
hanks for everyones input ! If you have any idea about the id's I wouldn't mind understanding exactly what is going on there. -bp On Sep 3, 12:41 am, Frederick Cheung wrote: > On Sep 3, 1:20 am, brianp wrote: > > > Hey everyone thanks for the input. >

[Rails] Re: Function Testing Reloading Fixtures before assertion

2009-09-02 Thread brianp
Hey everyone thanks for the input. I've tried your suggestions with varying results: def test_should_delete_word assert_equal 'published', words(:one).status debugger delete :destroy, :id => words(:one).to_param Word.reload word_status=Word.find(:id).status assert_equal '

[Rails] Function Testing Reloading Fixtures before assertion

2009-09-01 Thread brianp
Hey Everyone, I have a function test the is failing (despite the fact the function actually works in the application). I was looking for some debug advice on how to find my problem. Here is the test: def test_should_delete_word assert_equal 'published', words(:one).status debugger d

[Rails] Re: Netsted each loops *Solved*

2009-08-31 Thread brianp
Found my problem: I needed to call the attributes array directly on each definition object. <% @word.definitions.each do |h| %> <% h.attributes.each do |i| %> <%=h i %> <% end %> <% end %> On Aug 31, 2:04 am, Colin

[Rails] Nested each loops

2009-08-31 Thread brianp
Hey, *sorry for double post* So I keep getting "undefined method `each' for #". The call that gets made returns 1 word object with 2 definition objects. I can verify both definition objects get returned with all there attributes because I can output data like this: <% @word.definitions.e

[Rails] Netsted each loops

2009-08-31 Thread brianp
Hey, So I keep getting "undefined method `each' for #". The call that gets made returns 1 word object with 2 definition objects. I can verify both definition objects get returned with all there attributes because I can output data like this: <% @word.definitions.each do |h| %>

[Rails] Re: 1 Form > 2 Models > 2nd Model Requres 1st Model ID *Solved*

2009-08-30 Thread brianp
#x27;, :word_id => @word.id, :status => 'published')) @definition.save end rescue ActiveRecord::RecordInvalid => invalid flash[:notice]

[Rails] Re: 1 Form > 2 Models > 2nd Model Requres 1st Model ID

2009-08-28 Thread brianp
I can handle building two models from 1 form. It's getting the id from the first saved model and inserting it in the second and rolling back the whole transaction if anything goes wrong that is the problem. On Aug 28, 9:43 am, Ar Chron wrote: > google "rails 1 form 2 models" > -- > Posted viahtt

[Rails] 1 Form > 2 Models > 2nd Model Requres 1st Model ID

2009-08-28 Thread brianp
Hey Everyone, So I have one form that submits information to create 2 models (A, B). I need the ID of model A to be inserted into model B. But the ID isn't created until it hits the database (auto_increment). But if for some reason either item cannot be created or saved I want to abort the whole

[Rails] DB / App Best Practice

2009-08-26 Thread brianp
store ALL users (including admin) in the same user table? Separated by an account_type (ie. reg_user, admin_user). If this is the case should I make an account_type table to store account types? Thanks for the input, brianp --~--~-~--~~~---~--~~ You received this mess

[Rails] Starter DB's (general web app question) Where to get them?

2009-08-19 Thread brianp
Hey, I was wondering where people scrape information for the beginning of production db's for particular things. Like if I wanted to have a website related to cars. Someones isn't actually entering in every vehicle type manually theres got to be a solid method of finding that data somewhere that

[Rails] Method not found > Error page

2009-08-18 Thread brianp
Hey, I was wondering. If someone travels to a url ie. app.com/controller/method and method does not exist. How do i present them with a page not found error instead of getting Rails method not found errors? thanks, bp --~--~-~--~~~---~--~~ You received this messag

[Rails] password + salt

2009-08-12 Thread brianp
Hey Again, So I'm still working through AWDwR and I've just completed the authentication section for users. I understand the idea behind salts and general authentication. The part I feel I'm missing is when the first salt is created and stored to the db. (I can post the code but I assume anyone w

[Rails] Re: Assignment with << ?

2009-08-12 Thread brianp
Thanks for the clarification everyone! I wouldn't have expected it to have different meaning depending on he object/class type. I'll keep an eye out for that. On Aug 12, 9:40 am, Marnen Laibow-Koser wrote: > Frederick Cheung wrote: > > On Aug 12, 4:37 pm, Marnen Laibow-Koser > s.net> wrote: >

[Rails] Re: Assignment with << ? **solved**

2009-08-11 Thread brianp
On Aug 11, 2:38 pm, Conrad Taylor wrote: > Also, I would recommend getting a copy of the 'Programming Ruby' and/or > 'Programming Ruby 1.9'. > > -Conrad thanks for the help/recommendation. In the passed 2 week I went through Simply Rails 2, now AWDWR, next up is Why's (Poignant) Guide to Ruby, t

[Rails] Assignment with << ?

2009-08-11 Thread brianp
this point im assuming) a regular assignment operator = could do? thanks, brianp --~--~-~--~~~---~--~~ 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-

[Rails] http://admin.webapp.con

2009-08-06 Thread brianp
Hey everyone! I just finished through Simply Rails 2 and after looking around a bit I've decided I want my admin panal laid out like the subject line. My question is once an app gets moved to a subdomain don't you lose allot of privledges/permissions on the main app? Is there an example around I m

[Rails] Re: Trouble understanding Routes

2009-07-31 Thread brianp
_many => :votes, :collection => { :bin => :get } // And the default layout for all routes not specifically set above map.root :controller => "stories" map.connect ':controller/:action/:id' map.connect ':controller/:action/:id.:format' Thanks again

[Rails] Trouble understanding Routes

2009-07-31 Thread brianp
Hey Everyone, I'm new to Rails and working through the book Simply Rails 2. I've just hit one of my first large snags. This *was* my routes file: map.resources :stories, :has_many => :votes, :collection => { :bin => :get } map.connect ':controller/:action/:id' map.connect ':controller/:act