[Rails] Re: Use Carrierwave with Active Admin?

2014-09-16 Thread Heinz Strunk
The current versions work for me. Example: form :html = {:multipart = true} do |f| f.inputs Blog do f.input :blog, :as = :select f.input :video_link f.input :image, :as = :file, :hint = f.template.image_tag(f.object.image.url(:thumb)) f.input :image_cache, :as =

[Rails] RSpec doesn't give me any backtrace

2011-12-05 Thread Heinz Strunk
Hey, I trying to get a backtrace with rspec but I can't get it working for some reason. This is the test file: require 'spec_helper' describe ActivityReport do it should create a new instance given valid attributes do activity = Factory(:activity_report) end end This is the command I

[Rails] Use Carrierwave with Active Admin?

2011-11-25 Thread Heinz Strunk
Hey, did any of you guys manage to get Active Admin with Carrierwave working? When I installed AA everything worked fine but the image file upload fields were plain text fields so added following: ActiveAdmin.register Club do form do |f| f.inputs Club do f.input :league f.input

[Rails] Re: Path helper doesn't get object's id automatically anymore?

2011-11-25 Thread Heinz Strunk
Yes, routes are there: admin_clubs GET/admin/clubs(.:format) {:action=index, :controller=admin/clubs} POST /admin/clubs(.:format) {:action=create, :controller=admin/clubs} new_admin_club GET/admin/clubs/new(.:format)

[Rails] Re: Path helper doesn't get object's id automatically anymore?

2011-11-24 Thread Heinz Strunk
No one? I'm kinda stuck here... -- Posted via http://www.ruby-forum.com/. -- 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 group, send email

[Rails] Path helper doesn't get object's id automatically anymore?

2011-11-22 Thread Heinz Strunk
Hey, for some reason my admin_club_path(club) doesn't work anymore but only admin_club_path(club.id). Anyone know what the reason could be? This is the error message: No route matches {:action=show, :controller=admin/clubs, :id=#Club id: 98, name: 1. FSV Mainz 05 II, image: mainz05.gif,

[Rails] Rails 3.1, stylesheet assets not being reloaded correctly?

2011-11-01 Thread Heinz Strunk
Hi, I'm working on a Rails 3.1 project at the moment and having a hard time getting the stylesheets properly loaded. My application.css.scss looks like this: /* * This is a manifest file that'll automatically include all the stylesheets available in this directory * and any sub-directories.

[Rails] Cannot run server/rake/spork/rspec or anything due to some failed tests

2011-10-15 Thread Heinz Strunk
Hey, I ran into a very weird problem and after trying to solve it for like 3 hours now and Google not willing to help me I have to ask you guys. I'm currently writing some Spec tests which fail because of some missing seed data. So rspec spec/ fails with:

[Rails] Re: Cannot run server/rake/spork/rspec or anything due to some failed tests

2011-10-15 Thread Heinz Strunk
I just tried to run rake db:migrate:reset and I got a different error but still some spec involved: ** Invoke db:migrate:reset (first_time) ** Invoke db:drop (first_time) ** Invoke db:load_config (first_time) ** Invoke rails_env (first_time) ** Execute rails_env ** Execute db:load_config **

[Rails] RSpec 2 not working on Rails 3.1.1

2011-10-14 Thread Heinz Strunk
Hey, I updated some Gems and now rspec seems to be broken. The weird thing is it fails because of Test::Unit which doesnt make much sense to me. /Users/username/.rvm/gems/ruby-1.9.2-p290@ror_project/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant

[Rails] Stream user's computer output to server?

2011-10-11 Thread Heinz Strunk
Hey, it might be a bit off topic but I hope I'm still allowed to post this. I'm currently looking for something (whatever language, script, ...) that allows users to click a button and stream the audio output of their computer to the server. Does anyone know anything that does this? Thanks --

[Rails] Re: Stream users computer output to server?

2011-10-11 Thread Heinz Strunk
Yeah, exactly. I don't want a file upload. I want somebody to click a button and then the audio output of for example his music application streams to the server and then shoutcasted. What do you mean by any makers and advise not to? -- Posted via http://www.ruby-forum.com/. -- You received

[Rails] Re: Stream user's computer output to server?

2011-10-11 Thread Heinz Strunk
Colin Law wrote in post #1026101: On 11 October 2011 15:41, Heinz Strunk li...@ruby-forum.com wrote: Do you mean click a button on a web page? If so then I hope that it is not possible. It should not be possible to do such things from a browser. If you are not talking about in the browser

[Rails] Re: Re: Stream users computer output to server?

2011-10-11 Thread Heinz Strunk
Norbert Melzer wrote in post #1026121: I meant any malware would be capable of that. And said this correctly and not got it broken by T9 it should be clearly visible why I recommended not to do this! -- send by Samsung Galaxy Tab with Overcome Mod Am 11.10.2011 18:10 schrieb Heinz Strunk

[Rails] Fork and run external application and use telnet to control it?

2011-10-10 Thread Heinz Strunk
Hello, I need to build a web based control panel für an external application which cannot be detached. When I'm running it at the moment I need two terminal windows and it looks like this: Window 1: $ ./ext_app ...server started Window 2: $ telnet localhost 9000 connected to server input:

[Rails] API request with email in address path possible?

2011-10-07 Thread Heinz Strunk
Hey, I'm currently implementing a API for a website which is supposed to support following requests: /api/users/id/1 /api/users/email/t...@example.org ... Of course the email address with its dot causes an error because if the .org which is interpreted as file format. How can I pass an email

[Rails] Re: API request with email in address path possible?

2011-10-07 Thread Heinz Strunk
Oh, yeah... I actually added the /id/ part by accident. So the only way to pass an email is by a paramter like ...?email=xxx? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this

[Rails] Re: API request with email in address path possible?

2011-10-07 Thread Heinz Strunk
makes sense, thanks a lot for the explanation :) -- Posted via http://www.ruby-forum.com/. -- 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] undefined method keys for ActiveRecord::Relation when executing to_json

2011-10-05 Thread Heinz Strunk
Hello, I just ran into a strange error. In console I typed in following: ruby-1.9.2-p290 :120 User.first.to_json User Load (0.7ms) SELECT `users`.* FROM `users` LIMIT 1 = {\avatar_id\:10,\email\:\pe...@example.org\,\firstname\:\Peter\,\lastname\:\L\,\user_role_id\:11} and when I try that

[Rails] Re: undefined method keys for ActiveRecord::Relation when executing to_json

2011-10-05 Thread Heinz Strunk
Oh, yeah. You might be right with the reserved word! avatar.rb: class Avatar ActiveRecord::Base attr_accessible :name, :level, :current_xp, :overall_xp, :gender_cd as_enum :gender, :female = 0, :male = 1 has_one :user has_many :attributes ... attribute.rb: class Attribute

[Rails] Re: undefined method keys for ActiveRecord::Relation when executing to_json

2011-10-05 Thread Heinz Strunk
Ehm, yes. Changing it to has_many :avatar_attributes, :class_name = 'Attribute' did the trick. Thanks a lot for the hint, Colin! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this

[Rails] Re: FactoryGirl doesnt produce unique names?!

2011-09-08 Thread Heinz Strunk
Frederick Cheung wrote in post #1020639: On Sep 7, 2:55pm, Heinz Strunk li...@ruby-forum.com wrote: tests run inside a transaction so (by default at least) you can't see what's in the test database from outside the test. Probably worth sticking a breakpoint in there so that you can poke around

[Rails] Re: FactoryGirl doesnt produce unique names?!

2011-09-08 Thread Heinz Strunk
ayiana wrote in post #1020780: To get unique values you need to define name using the sequence in brackets eg. c.name { Factory.next(:country_name) }. That's way you'll get country with unique name each time you call Factory(:country). Perfect, thanks a lot! -- Posted via

[Rails] FactoryGirl doesnt produce unique names?!

2011-09-07 Thread Heinz Strunk
Hey, I got following very simple test case: require 'spec_helper' describe Country do it should create a new instance given valid attributes do Factory(:country) end end Factory looks like: Factory.sequence :country_name do |n| Country #{n} end Factory.define :country do |c| c.name

[Rails] Re: FactoryGirl doesnt produce unique names?!

2011-09-07 Thread Heinz Strunk
What do you mean? I checked the test database and it's running on a MySQL server with mysql2 gem. -- Posted via http://www.ruby-forum.com/. -- 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: How to handle non model data in form?

2011-05-22 Thread Heinz Strunk
Yes, of course! Thank you guys :) -- Posted via http://www.ruby-forum.com/. -- 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 group, send

[Rails] How to handle non model data in form?

2011-05-19 Thread Heinz Strunk
Hey, I got a form which looks like this: - form_for(@article, :html = {:multipart = true}, :url = articles_path) do |f| = errors_for(@article) .field = f.label :text %br = f.text_field :text .field = f.label :author_id %br = f.text_field :author_id .actions

[Rails] Communication between two apps?

2011-03-30 Thread Heinz Strunk
Hey folks, I have two different Rails apps and I would like t o sync the user databases. What's the best way to do that? I thought of whenever someone registers with one app the user information is posted to the other app and vice versa. What would you use for that? JSON? Sinatra? Thanks for the

[Rails] Most Viewed, Hot! kinda of thing as a Gem?

2011-02-25 Thread Heinz Strunk
Hey, does anyone know if there's a Gem that has some kind of counter function for the models being viewed so I could create something like Most Viewed, Hot! etc.? Simple counter doesn't help since I need to know most visits within the last week and stuff. Hope there's something like that out

[Rails] Multiple Strings for one string to translate?

2011-02-22 Thread Heinz Strunk
Hey, is it somehow possible to translate one string e.g. t('hello') to a random item of a number of strings? Example for language files (I know, wrong syntax): en: hello: Hello, G'day, Hey, Hi So every time t('hello') is rendered on of the strings is randomly given out? Like: puts

[Rails] Re: Re: Rails 3 + Authlogic not working all of a sudden

2011-02-09 Thread Heinz Strunk
My problem disappeared after some weeks of ignoring it, still no freaking idea what caused it and what made it disappear again but your template looks very interesting. Will give it a try once it's back :) -- Posted via http://www.ruby-forum.com/. -- You received this message because you are

[Rails] Re: Bug/Feedback/Suggestion report gem?

2011-01-30 Thread Heinz Strunk
Since I couldn't find any gem I decided to go with UserEcho. -- Posted via http://www.ruby-forum.com/. -- 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

[Rails] Bug/Feedback/Suggestion report gem?

2011-01-28 Thread Heinz Strunk
Hello, I've been googling a bit and didn't find anything at all so I thought I'd give it a try in this forum since it always helped me. I'm looking for a gem that adds the functionality of easily sending feedback, make suggestions or report a bug (something like uservoice etc.). Is there any gem

[Rails] Best practice for root?

2011-01-16 Thread Heinz Strunk
Good morning, I just started a new application and was wondering what the best practice for root (- http://localhost:3000/) is. My landing page is going to load data from 5 different models and I don't really know if I should put a welcome action in one of these 5 controllers or create something

[Rails] Re: Best practice for root?

2011-01-16 Thread Heinz Strunk
Yes it does, thanks Fidel! -- Posted via http://www.ruby-forum.com/. -- 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 group, send email to

[Rails] Rails 3, RSpec, Factory Girl results in NameError: uninitialized constant

2011-01-16 Thread Heinz Strunk
Hi people, I'm having a little trouble getting spec to run with Factory Girl on my new Rails 3 app. /spec/spec_helper.rb: # This file is copied to spec/ when you run 'rails generate rspec:install' ENV[RAILS_ENV] ||= 'test' require File.expand_path(../../config/environment, __FILE__) require

[Rails] Re: Rails 3, RSpec, Factory Girl results in NameError: uninitialized constant

2011-01-16 Thread Heinz Strunk
Yeah, just figured that out. Didn't know FactoryGirl was so strict about it. That one worked: Factory.define :video do |f| f.title MyString f.teaser MyText f.link MyString end Thanks! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to

[Rails] Re: Best practice for root?

2011-01-16 Thread Heinz Strunk
Working like a charm already, thanks a lot! -- Posted via http://www.ruby-forum.com/. -- 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 group,

[Rails] Re: I18n translate: one, other more?

2010-12-11 Thread Heinz Strunk
DON'T DO THIS! This is a completely inappropriate use of t(). Instead, have a helper function that takes a number and returns the appropriate string. Could be as simple as def health(count) statuses = ['dead', 'injured', 'not well'...] statues[count] end Looks a lot more

[Rails] I18n translate: one, other more?

2010-12-09 Thread Heinz Strunk
Hello, I would like to have a range of strings being returned using t() function from I18n. Example: t('health', :count = 0) # dead t('health', :count = 1) # injured t('health', :count = 2) # not well t('health', :count = 3) # so so t('health', :count = 4) # just fine t('health', :count = 5) #

[Rails] Re: Rails 3 + Authlogic not working all of a sudden

2010-12-05 Thread Heinz Strunk
Removed and reinstalled all gems. Same... getting a bit desperate now. -- Posted via http://www.ruby-forum.com/. -- 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

[Rails] Re: Re: Rails 3 + Authlogic not working all of a sudden

2010-12-03 Thread Heinz Strunk
Colin Law wrote in post #965721: Can't you roll back in your source control system to a version that worked and determine the cause of the problem that way? Or do you think it was a change in your system (gem upgrade or whatever) that caused the problem to appear. Colin I did a rollback

[Rails] Rails 3 + Authlogic not working all of a sudden

2010-12-02 Thread Heinz Strunk
Hey People, I've been working on Rails 3.0.0 and Authlogic for quite a while now but all of a sudden I can't login into my application anymore. After some research I found out that no sessions are stored into the db anymore so I started the console and saw this: ruby-1.9.2-p0 u =

[Rails] Re: Rails 3 + Authlogic not working all of a sudden

2010-12-02 Thread Heinz Strunk
Apparently, this part of the code causes the trouble: def save_cookie controller.cookies[cookie_key] = { :value = #{record.persistence_token}::#{record.send(record.class.primary_key)}, :expires = remember_me_until, :domain =

[Rails] Hardware question: dual or quad core?

2010-11-26 Thread Heinz Strunk
Hey people, I'm planning to get a new notebook which will be primarily used for RoR development. I'm not sure whether to get a i5 (dual core) or i7 (quad core) cpu. I did a google search and stuff and couldn't really find any benchmarks or something like that about multi core support of Ruby/RoR.

[Rails] Re: Hardware question: dual or quad core?

2010-11-26 Thread Heinz Strunk
Well, at the moment I'm on a Core2Duo and 3GB of RAM. CPU usage is ~90% and RAM alltogether 2.0 - 2.5 GB used. I'm planning to go on 6 or even 8 GB the only question remaining is whether it's gonna be a i5 or a i7. -- Posted via http://www.ruby-forum.com/. -- You received this message

[Rails] Background thing for Rails 3?

2010-11-22 Thread Heinz Strunk
Hey people, I've been looking for a easy and simple background thing for Rails 3 for more than 3 hours now and couldn't find anything useful. I've been using Rufus Scheduler before I switched to Rails 3 which worked like a charm but unfortunately it's not working in Rails 3 anymore. So

[Rails] Re: Deprecated error_messages, what to use now?

2010-11-11 Thread Heinz Strunk
What do you mean by when it is ready? It is kinda ready :) -- Posted via http://www.ruby-forum.com/. -- 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

[Rails] db:fixtures:load not working anymore?!

2010-11-09 Thread Heinz Strunk
Hello people, for some reason my db:fixtures:load FIXTURES=menus doesn't work anymore. This is my output: debian:/var/www/project# rake db:fixtures:load FIXTURES=menus (in /var/www/project) rake aborted! Could not find /var/www/project/test/fixtures/m.yml or /var/www/project/test/fixtures/m.csv

[Rails] Re: db:fixtures:load not working anymore?!

2010-11-09 Thread Heinz Strunk
Problem solved, I played around and figured out that Rails 3 apparently needs the file ending as well. rake db:fixtures:load FIXTURES=menus.yml works fine! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails:

[Rails] Re: db:fixtures:load not working anymore?!

2010-11-09 Thread Heinz Strunk
Haha, I know. It's just a small part that remained in fixture and too lazy to move them to machinist. Will do soon, promise! :) -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this

[Rails] Re: rails 3 remote server startup problem with mongrel_rails

2010-11-01 Thread Heinz Strunk
Again: what does your log say? -- Posted via http://www.ruby-forum.com/. -- 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: incompatible character encodings: ASCII-8BIT and UTF-8

2010-10-20 Thread Heinz Strunk
It's not a satisfying solution but whenever I ran into this problem I added # Encoding: utf-8 to the top of the file causing this problem and it worked. Would love to know how to get rid of all these comments and fix it for real though :) -- Posted via http://www.ruby-forum.com/. -- You

[Rails] Re: Server extremely slow?!

2010-10-12 Thread Heinz Strunk
Erol Fornoles wrote in post #947325: I know you've already resolved your problem, but for the sake of discussion, WEBrick in it's default state is notoriously slow when being accessed remotely. You can speed it up by looking for webrick/ config.rb in your ruby's install path and changing the

[Rails] Server extremely slow?!

2010-10-10 Thread Heinz Strunk
Hello, for some reason my WEBrick server became extremely slow. My development server is running on a Debian system. After some days of test writing only I started the server to do some manual testing and it took 86 seconds(!) to load the page. I was checking everything but couldn't find

[Rails] Re: protecting resources in an app

2010-10-10 Thread Heinz Strunk
I'm doing it just like you described above. However I would like to hear some more opinions on that as well. -- Posted via http://www.ruby-forum.com/. -- 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: The requested URL /rails/myrailsapp/public/rails/info/properties was not found on this server.

2010-10-10 Thread Heinz Strunk
julianomoreira wrote: I'm a newbie to ruby on rails. I'm trying to install ruby on rails on ubuntu server but i'm getting this error. http://julianomoreira.kicks-ass.org/rails/myrailsapp/public/ Any help is appreciated! Thanks! Julinao That's no error but the public/index.html? --

[Rails] Re: How do I convert this active record query to a rails 3 query

2010-10-10 Thread Heinz Strunk
Christian Fazzini wrote: Video.where({:genre = 'Acoustic', :include = {:artist = {:user = :genre}}}) Does NOT work. What am I missing? What about: Video.includes(:artist = {:user = :genre}).where(:genre = 'Acoustic') ? -- Posted via http://www.ruby-forum.com/. -- You received this

[Rails] Re: Server extremely slow?!

2010-10-10 Thread Heinz Strunk
Thanks, I was still on WEBrick because Mongrel caused lot of trouble on Rails 3 and Ruby 1.9.2 but I switched to thin and now 86 seconds became 3 seconds. Pretty alright :) Still ridiculous performance from WEBrick. -- Posted via http://www.ruby-forum.com/. -- You received this message

[Rails] Re: Re: free ruby on rails hosting?

2010-10-04 Thread Heinz Strunk
Thanks, will try that! -- Posted via http://www.ruby-forum.com/. -- 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

[Rails] Re: Can't modify frozen hash

2010-10-03 Thread Heinz Strunk
Luke Cowell wrote: Your code freezing on the self.target.save line, made me think you had a before_save filter. The Building.find(1008631573) freezing makes me think that there's something un-vanilla about your rails install. Try removing all plugins, gems and any initializers that you

[Rails] Re: Can't modify frozen hash

2010-10-03 Thread Heinz Strunk
Frederick Cheung wrote: An alternative approach is to take your existing app and to remove stuff until things work again. One thing that appeared suspicious to me is the association called target - association proxies have a method called target, so while I wouldn't expect foo.target to cause

[Rails] Re: Can't modify frozen hash

2010-10-03 Thread Heinz Strunk
Alright, renaming it didn't help but I think I need to make the whole thing a bit more clear. self is an activity which is on a building in the case where it fails. I've got about 6 different activities and all work but one. So my test executes this activities 100 times to see the success rate

[Rails] Can't modify frozen hash

2010-10-02 Thread Heinz Strunk
Hello, eversince I switched to Rails 3 I keep getting following error: RuntimeError: can't modify frozen hash This is the affected line: self.target.save target is a polymorphic relation and never caused any problems before. I added an output for the frozen hash to get the ID of it and fired

[Rails] Re: Extract all routes and test their views?

2010-09-30 Thread Heinz Strunk
Robert Walker wrote: An alternative, or more likely in combination with cucumber stories, RSSpec provides routing expectations: Examples: route_for(:controller = hello, :action = world).should == /hello/world params_from(:get, /hello/world).should == {:controller = hello, :action =

[Rails] Autotest or alternative for Rails 3?

2010-09-29 Thread Heinz Strunk
Hey people, I normally used autotest to when writing test which worked just fine until I switched to Rails 3. Now, when I run autotest it tests all tests and gets stuck somewhere: Loaded suite -e Started

[Rails] Re: rails 3 remote server startup problem with mongrel_rails

2010-09-29 Thread Heinz Strunk
What exactly does the log say? -- Posted via http://www.ruby-forum.com/. -- 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

[Rails] Re: Extract all routes and test their views?

2010-09-29 Thread Heinz Strunk
That's not really what I was looking for but I'll give it a shot. Thanks! -- Posted via http://www.ruby-forum.com/. -- 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.

[Rails] Re: Autotest or alternative for Rails 3?

2010-09-29 Thread Heinz Strunk
Unfortunately I'm on Unix so I can't use autotest-fsevent but I have tried to only use: autotest autotest-growl It doesn't get stuck anymore but I think it's because it doesn't run the tests anymore: Loaded suite -e Started Finished in 0.016008 seconds. 0 tests, 0 assertions, 0 failures, 0

[Rails] Re: Problem With Active Record. Associations Showing Error ..ple

2010-09-17 Thread Heinz Strunk
Apparently one or more of your ledgers doesn't have a journel? Try: td%=h ledger.journel.journal_name if ledger.journel %/td to see the ones that don't have journels. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on

[Rails] Re: Extract all routes and test their views?

2010-09-17 Thread Heinz Strunk
I'm not sure how to get all routes (I guess you wanna test all routes from rake routes?) but route testing is quite easy. Should look somehow like this: test should route to post do assert_routing '/pages/1', { :controller = pages, :action = show, :id = 1 } end -- Posted via

[Rails] Re: Problem With Active Record. Associations Showing Error ..ple

2010-09-17 Thread Heinz Strunk
I doubt there's a problem with Rails 2.3.5 Fire up the console and try following: ledger = Ledger.first ledger.journel = Journel.first ledger.journel.journal_name This should work and if so the ledgers you're calling in the view just doesn't have a journel. If not something's wrong with the

[Rails] Deprecated error_messages, what to use now?

2010-09-17 Thread Heinz Strunk
Hey, as you all may know error_messages are deprecated: DEPRECATION WARNING: f.error_messages was removed from Rails and is now available as a plugin. Please install it with `rails plugin install git://github.com/rails/dynamic_form.git` Installing the plugin of course helps but I've been

[Rails] Re: Deprecated error_messages, what to use now?

2010-09-17 Thread Heinz Strunk
Alright, thanks! Will build my own helper method then. -- Posted via http://www.ruby-forum.com/. -- 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

[Rails] Re: Rails 3: finding a record by name in multilingual app

2010-09-14 Thread Heinz Strunk
Michael Schuerig wrote: with_locale(:en) { Page.find_by_name('Welcome') } Thanks, but there's a little something that makes me not being able to use it. I got another field called content which has the actually content of the page. When I use it with with_locale I get the english content

[Rails] Re: Could not find [GEM] locally or in a repository

2010-09-13 Thread Heinz Strunk
gem -v and ruby -v in your terminal window -- Posted via http://www.ruby-forum.com/. -- 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,

[Rails] Re: Re: Could not find [GEM] locally or in a repository

2010-09-13 Thread Heinz Strunk
I think they recently added 1.9.1 to the apt thing. Try this: sudo apt-get install ruby1.9.1-full Even though 1.9.2 is out already. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this

[Rails] Re: after_create not being called in seeds.rb?

2010-09-13 Thread Heinz Strunk
@brito: self always worked cause it's the instance of the current object which I wanna use so that should be fine. @Marnen: Actually they're not really users but NPCs which I need for various things and I need a lot of them to populate the world. Therefore it's not for test but to populate and

[Rails] Re: Rails 3: finding a record by name in multilingual app

2010-09-13 Thread Heinz Strunk
What that not specific enough? I really don't know how to proceed right now cause there's no proper way to avoid name. This is my latest approach which I don't like at all but well... Page.find(Fixtures.identify(:welcome)) Works for every language but not so nice. Anyone else got a better

[Rails] Re: after_create not being called in seeds.rb?

2010-09-13 Thread Heinz Strunk
Marnen Laibow-Koser wrote: Please quote when replying; otherwise, it gets difficult to follow the discussion. So this is actual production data? Yes, it is. It's not appropriate to use an after_create for this sort of thing, I think. In your 100.times block, just create a comment

[Rails] Re: Rails 3: finding a record by name in multilingual app

2010-09-13 Thread Heinz Strunk
This is completely fishy. Rails is not supposed to translate strings behind your back. Are you any extensions (gems, plugins) that may try to be helpful in the wrong way? Well, I used globalize2 when I used Rails 2.3.8 and everything worked perfectly fine but no new gems or anything eversince.

[Rails] Re: after_create not being called in seeds.rb?

2010-09-13 Thread Heinz Strunk
For some stupid reason it's working now. My guess is a Windows reboot did the magic ;) It is indeed much nicher! Thanks everybody! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this

[Rails] Re: Re: Rails 3: finding a record by name in multilingual app

2010-09-13 Thread Heinz Strunk
yes i understand what you say now, but it seems that is a problem with the gem. I dont know globalize2 ill read on it and try to help. Thanks in advance I do appreciate but I'm using globalize3 and not 2 anymore :) -- Posted via http://www.ruby-forum.com/. -- You received this message

[Rails] Re: Re: after_create not being called in seeds.rb?

2010-09-13 Thread Heinz Strunk
put the function in the loop after the user.save ? What exactly do you mean by put it in the loop after .save? -- Posted via http://www.ruby-forum.com/. -- 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: Re: Re: Rails 3: finding a record by name in multilingual app

2010-09-13 Thread Heinz Strunk
Nope not yet but you said you'll try to help and appreciate it. -- Posted via http://www.ruby-forum.com/. -- 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

[Rails] Re: Re: Re: after_create not being called in seeds.rb?

2010-09-13 Thread Heinz Strunk
Ah, I see. Yeah, after_create seems better after all. -- Posted via http://www.ruby-forum.com/. -- 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

[Rails] after_create not being called in seeds.rb?

2010-09-12 Thread Heinz Strunk
Hello, I'm using the seeds.rb to create some user records: 100.times do user = User.new user.username = Faker::Name.first_name user.email = user.username+@example.com user.save! end This works just fine and the users have been created after I ran db:seeds but what's not working is:

[Rails] Re: Resource routes: optional path components

2010-09-12 Thread Heinz Strunk
Hey, have you tried match? I'm using it and still can use _path and _url without a problem. -- Posted via http://www.ruby-forum.com/. -- 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] Rails 3: finding a record by name in multilingual app

2010-09-12 Thread Heinz Strunk
Hello, I upgraded my application from Rails 2 to Rails 3 and ran into a problem. In rails 2 I could use the english name of the record to find it like: Page.find_by_name(Welcome) even though the user chose German as the language (which of course showed the German welcome page. Eversince I

[Rails] Re: Rails 3: finding a record by name in multilingual app

2010-09-12 Thread Heinz Strunk
Well, I have been using Page.find_by_name(Welcome) in my code all the time when I was on Rails 2 (and globalize2, of course) and no matter what language was selected by the user it was always possible to load the welcome page with this command: Page.find_by_name(Welcome) Eversince I switched

[Rails] Re: Could not find [GEM] locally or in a repository

2010-09-12 Thread Heinz Strunk
Which versions? -- Posted via http://www.ruby-forum.com/. -- 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

[Rails] Re: Could not find [GEM] locally or in a repository

2010-09-12 Thread Heinz Strunk
I mean Gem and Ruby -- Posted via http://www.ruby-forum.com/. -- 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

[Rails] Rails 3: many to many polymorphic relationship

2010-09-01 Thread Heinz Strunk
Hello, I've been googling for about two hours already but not successful yet so I hope you guys can help me out. I need some kind of n:m polymorphic relation like this: building_types: living, shops block_types: residential, commercial activity_types: act1, act2 So now I need a connection

[Rails] Re: Rails 3: Error saving an object with no useful information

2010-08-24 Thread Heinz Strunk
No, exactly that is the problem. I never used .to_ary in my code. Where can I see the debug log of the console? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email

[Rails] Re: Rails 3: Error saving an object with no useful information

2010-08-23 Thread Heinz Strunk
No one? I'm kinda desperate with that problem... -- Posted via http://www.ruby-forum.com/. -- 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

[Rails] Re: Rails 3: Error saving an object with no useful information

2010-08-23 Thread Heinz Strunk
I'm using console and I restarted and reloaded it a couple of times. Rails 3.0.0.rc and Ruby 1.9.2 -- Posted via http://www.ruby-forum.com/. -- 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] rails3: t.index in migrations not working anymore

2010-08-22 Thread Heinz Strunk
Hello, I'm playing around with Rails3 and trying to upgrade one of my applications to Rails 3.0.0.rc and I get an error which should be still working. Migration: t.index :name When I execute rake: rake aborted! An error has occurred, all later migrations canceled: undefined method `index' for

[Rails] Rails 3: Error saving an object with no useful information

2010-08-22 Thread Heinz Strunk
Hey, I'm kinda desperate cause I'm getting an error and have no idea how to fix this since it doesn't give me any information hinting where the problem is: irb(main):054:0 reload!;User.last.save! Reloading... NameError: undefined local variable or method `to_ary' for #User:0x4ed5d20 from

[Rails] Re: Test Database Empty after rake test?

2010-08-12 Thread Heinz Strunk
Yeah, you're right. Might switch to Factories instead. Don't really need 500 NPC when I can test all the stuff having 5-10 :) -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this

[Rails] Run tests from IRB?

2010-08-07 Thread Heinz Strunk
Hello, is it possible to run single test files from the IRB? I'm using Windows and it always takes a very long time until ruby is initialized (about 20 seconds) so I would save quite some time if I could run the test files from the IRB because ruby is loaded already and it's a lot faster. --

  1   2   3   >