[Rails] Problems connecting Postgres-pr with rails 2.3.5 on windows 7

2010-12-31 Thread Mad Chipset
I changed my laptop for a one with windows 7. I installed rails 2.3.5, postgres-pr 0.6.3, mongrel 1.1.5 and copied my app that was previously on a win xp PC. When I launched my server and connected to my app, I had the following error : Status: 500 Internal Server Error uninitialized constant

[Rails] Re: Rails base model

2010-09-17 Thread MaD
sorry to say, but your short answer is wrong. class AppModel ActiveRecord::Base end Table 'blog_development.app_models' doesn't exist My question is, how do I tell Rails not to look for a table named app_models AND am I even taking the right approach here? Is there a better way to

[Rails] Re: FCK editor implementaion to rails app

2010-05-13 Thread MaD
would be nice to see your code. how are you trying to do this? obviously, you don't want to use any escaping (like the h-function does), but don't forget about security issues like cross-site scripting. -- You received this message because you are subscribed to the Google Groups Ruby on Rails:

[Rails] Re: file.exists not working

2010-05-05 Thread MaD
maybe this is due to your relative path. are you sure the file is where you think it is? are you sure the current working directory is what you think it is? try File::exists?(#{RAILS_ROOT}/path/to/my/file) another thing: since you obviously left out some code and replaced it with ... we can't be

[Rails] Re: uninitialized constant when trying to migrate files

2010-05-05 Thread MaD
whats the name of your file? looking at the class it should be named *_create_u_r_ls.rb. if it is called *_create_urls.rb then your class should be CreateUrls. smae with your model. try Url instead of URL. -- You received this message because you are subscribed to the Google Groups Ruby on

[Rails] Re: Rails 2.3.5 - missing gem problem

2009-12-01 Thread MaD
reverting is easy. just uninstall your current rails-gem. if didn't uninstall 2.3.4 it should still be there and your done. if you uninstalled it, just install it with -v=2.3.4. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to

[Rails] Re: attachment_fu, how to regenerate thumbnails

2009-11-26 Thread MaD
why don't you just write a migration that loops all of those objects with the old thumbnail-information and call the method that generates the thumbnails again. like this: MyModel.find_all_with_thumbnails.each(:generate_thumbnail) i'd like to add: i don't know your app and i don't use

[Rails] Re: RoR Agile

2009-11-26 Thread MaD
if you want an agile approach try setting your goals (and that means maybe break them down in little pieces) and realize them one after the other. that means: don't install all your plugins at once, but only those you need for your next step. write a test like 'User should be able to login' and

[Rails] Re: has_many :through and foo.bars.include?

2009-11-24 Thread MaD
thanks a lot for your replies! i already changed my :conditions. but i have an additional question about that: should i change :order-statements accordingly (to also include the brackets)? as for my original problem: thanks matt! your post put me into a new direction. i really found an old

[Rails] Re: has_many :through and foo.bars.include?

2009-11-24 Thread MaD
just tried it. removing the kind_of-attribute did the trick! THANKS! that bug was really getting annoying. -- 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: a yield problem

2009-11-24 Thread MaD
%= yield % works like a 'catch-all' inside layout files. if you don't specify where some code should be rendered it just ends up there. you could also use %= @content_for_layout % there is a nice railscast by ryan bates covering that. -- You received this message because you are subscribed to

[Rails] Re: nil object - very strange behavior

2009-11-24 Thread MaD
maybe i'm wrong, but it could be something like the following: if your users (=hits) are User.find_by_ferret and thus of the class User. a user.user would return nil, like in this line: users.concat(hits.collect { |hit| hit.user }).uniq! now you have a collection of nils and try to call

[Rails] Re: a yield problem

2009-11-24 Thread MaD
%= yield :layout % outputs everything that is created with % content_for :layout do %...% end %. here is ryans railscast: http://railscasts.com/episodes/8-layouts-and-content-for -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to

[Rails] has_many :through and foo.bars.include?

2009-11-17 Thread MaD
hallo everybody, i already googled the following problem, but there are so many questions regarding has_many :through, that i just couldn't find what i was looking for. so, i'm really sorry if this has been asked before. if so, just drop me the link. i have a has_many :through relationship

[Rails] Re: create 1000 items in DB

2009-07-18 Thread MaD
and there is always the obvious solution: 1000.times do Voucher.create(:attribute1 = 'value1') end --~--~-~--~~~---~--~~ 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: German letter ä, ö, ü in rfpdf

2009-04-15 Thread MaD
You might wanna change Vorhunden to vorhanden to make it German. --~--~-~--~~~---~--~~ 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

[Rails] Re: map.resources problem

2009-04-14 Thread MaD
you should read-up on REST. still (without knowing your code) you can just use routes the old fashioned style like you used to have them in rails 2. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails:

[Rails] Re: how to eliminate replace_html alert pop-up in RJS

2009-04-02 Thread MaD
how about making it conditional? check existence of that div beforehand. --~--~-~--~~~---~--~~ 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 eliminate replace_html alert pop-up in RJS

2009-04-02 Thread MaD
there is a similar thread: http://www.ruby-forum.com/topic/87505 --~--~-~--~~~---~--~~ 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

[Rails] Re: About membership of this group

2009-03-23 Thread MaD
welcome, you are here. just ask. --~--~-~--~~~---~--~~ 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] Re: Clean way to handle prices

2009-03-22 Thread MaD
james already mentioned the best way to do this, but if that doesn't match your requirements, just write your own helper-method. stuff like that is not done inside the controller. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[Rails] Re: Instance variables in helpers?

2009-03-22 Thread MaD
maybe i misunderstand, but what i see is a helper-method in application_helper. i don't know how many times you call that method in one single view, but if you call it only once @rev is not yet set when you write it into your log file. does the method return your revision-number correctly? if

[Rails] Re: Rails making it tougher for newbies?

2009-03-22 Thread MaD
i can recommend this one for a good start: http://www.pragprog.com/titles/rails3/agile-web-development-with-rails-third-edition DHH mentioned that it is completly 2.3 ready. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[Rails] Re: may somebody can give me a detail steps about sqlite3 installation?

2009-03-21 Thread MaD
here you go: http://mislav.uniqpath.com/rails/install-sqlite3/ --~--~-~--~~~---~--~~ 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

[Rails] Re: Migrating rails website from one server to another

2009-03-21 Thread MaD
plugins are all inside your rails-project's directory. so moving that would move your plugins with it. and to make sure you got all the gems just list them (gem list) and reinstall the same version on your new machine. --~--~-~--~~~---~--~~ You received this

[Rails] Re: Migrating rails website from one server to another

2009-03-21 Thread MaD
forgot to state the (even more) obvious: dump your mysql-db to a file and insert it in your new db. --~--~-~--~~~---~--~~ 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: Redirecting to another controller, with a POST method

2009-03-19 Thread MaD
i think the difference is that form a view there can be a real POST (with user submitting data, pressing a button, ...), but a controller just GETs infos and stuff. i'm no expert, so that is just a guess. normally you POST things that create or destroy things. in other words actions that make a

[Rails] Re: re-initializing a controller or a model in production mode

2009-03-19 Thread MaD
@instance.reload is available for every ActiveRecord-Object. or you can use reload! to reload everything. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send

[Rails] Re: re-initializing a controller or a model in production mode

2009-03-19 Thread MaD
IIRC reload! is only defined in a console session that may be right. i never really used it anywhere else than in console. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this

[Rails] Re: Refactoring module

2009-03-18 Thread MaD
you can implement as many classes as you like. if you have something that is common to all of your Tasklist-classes you can of course create class GenericTasklist that holds the common code and form which Tasklist inherits. you should take a look into a book that explains OOP though. without

[Rails] Re: Flex and Rails - NoMethodError

2009-03-18 Thread MaD
where exactly is the error? which expression is nil? - params[:question] - params[:question][:id] - params[:question][:id][:value] did you debug it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails:

[Rails] Re: Flex and Rails - NoMethodError

2009-03-18 Thread MaD
i don't know about your system, but maybe you try to do something over ssl and you don't have it configured for your webserver? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to

[Rails] Re: Redirecting to another controller, with a POST method

2009-03-18 Thread MaD
first of all: i don't know if using POST with a redirect is possible. but other than that: i don't think you really need that. on the one hand you could just leave that if request.post? out and everything is fine. i don't think you really need to check for POST in logout. the user is not

[Rails] Re: Introducing the Ruby 1.9 or Bust Project

2009-03-18 Thread MaD
nice idea. thumbs up. --~--~-~--~~~---~--~~ 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] Re: Find all messages from all friends

2009-03-17 Thread MaD
Thanks Wolas, actually that worked fine :-) wow, i just learned something. ignore everything i said so far. i have to try that immediately... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk

[Rails] Re: capistrano error: not allowed to execute '/usr/bin/nohup script/spin'

2009-03-17 Thread MaD
duh. *g* --~--~-~--~~~---~--~~ 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] Re: about HAsh in ruby

2009-03-16 Thread MaD
well, you can do that like i posted before. only thing you have to add is maybe an ajax-call to reload that textarea. once you figured how to put default values into that text-area, and how to replace_html with ajax, this should be no problem. try it.

[Rails] Re: DEV Laptop : Ubuntu or Centos , Netbeans or Eclipse ?

2009-03-16 Thread MaD
that's a very personal decision. you gotta try and decide for yourself. personally i've been working on mac/textmate for a while and switched back to suse/kate which is a very good combination for me. my coworkers are using ubuntu/netbeans though.

[Rails] Re: render action in rails 2.3

2009-03-15 Thread MaD
don't you just want to render a template like this: %= render shared/footer % ? --~--~-~--~~~---~--~~ 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: very basic question - writing instance method

2009-03-15 Thread MaD
Will the instance method perform_sanity_check have access to @obj1 attributes? yes, with self.attribute --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send

[Rails] Re: null object pattern

2009-03-14 Thread MaD
If you have a construct like this (all in the same file): # app/models/user.rb class User ActiveRecord::Base # ... end class UnassignedUser User def self.shout puts yeah end end script/console will behave like this: UnassignedUser.shout NameError:

[Rails] Re: about HAsh in ruby

2009-03-14 Thread MaD
for this text_area: %= text_area( user, tasks, :cols=30, :rows=10) % default value would be to set @user.tasks = text_fields[:user_tasks] in your controller. hope this is what you were looking for. --~--~-~--~~~---~--~~ You received this message because you

[Rails] Re: Head First Rails Book

2009-03-13 Thread MaD
[quote] RailsSpace is an introductory book, so we don't assume any knowledge of the Ruby programming language or of the Rails framework. [/quote] personally i didn't read that book, but judging from the above statement (taken from the introduction of this book) it should be ok to get in touch

[Rails] Re: Session Expiry

2009-03-13 Thread MaD
CGI::Session.expire_after 2.hours that's not entirely true. the above mentioned code only works with the dynamic_session_exp plugin. without plugins for CGI::Session there are only few methods like new or delete (http://www.ruby-doc.org/core/ classes/CGI/Session.html).

[Rails] Re: Segment error loading rails

2009-03-13 Thread MaD
you gotta try to install rails 2.3. all other previous versions are not compatible with 1.9.1. on the other hand: anything could cause an error of which i don't even see the error-message... --~--~-~--~~~---~--~~ You received this message because you are

[Rails] Re: normalized table query not working now

2009-03-13 Thread MaD
take a look at the :include = :modelname option. --~--~-~--~~~---~--~~ 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

[Rails] Re: Error while installation of rails

2009-03-13 Thread MaD
try something like: sudo gem install rails --source http://gems.rubyonrails.org --~--~-~--~~~---~--~~ 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: Routing and AJAX problem.

2009-03-10 Thread MaD
you should read up on REST. maybe start here: http://railscasts.com/episodes/35-custom-rest-actions --~--~-~--~~~---~--~~ 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: crypto in Rails 2.x?

2009-03-10 Thread MaD
depends on what you are looking for. if want to have a one-way function (for passwords and such) just try it like this: encrypted_item = Digest::SHA256.hexdigest(“string_to_encrypt”) you could also use SHA1, SHA384, SHA512 depending on your need of security.

[Rails] Re: Hover effect for column data field...

2009-03-09 Thread MaD
you'll want to do this client-side to have no client/server- communication and thus instant loading of your content. rails ships with prototype, but it's still javascript. so, to answer your question: use javascript and css. add an observer for mouseover and then do whatever is necessary (i.e.

[Rails] Re: Importing application constants into models and backgroundrb workers - How To?

2009-03-09 Thread MaD
requiring your file should make them available for your models. there is something wrong with your code. # file.rb CONSTANT = loaded # some_model.rb class SomeModel ActiveRecord::Base require File.dirname(__FILE__) + '/some/path/to/your/file' def self.constant_status puts CONSTANT

[Rails] Re: Parsing html files = putting them in fixtures for testing

2009-03-07 Thread MaD
you are right. it seems like an error that occurrs after reading your yml-file. obviously there are some additional whitespaces/carriage returns added to it. but you could just gsub them. but other than that, one question: why do you want to save a html string in a yml-file (and not just read

[Rails] how to catch AJAX calls on session-timeout?

2009-03-06 Thread MaD
AJAX-calls (because there are many of them). surely there must be approaches on that subject already. but it's hard to google without some keywords to look for. thanks MaD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[Rails] Re: How can i know weather a record is saved or not?

2009-03-06 Thread MaD
i just want to know weather it is saved ? i don want to save it or try to save it ! well, if you dont try to save it, the answer to your question is quite easy: no. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[Rails] Re: how to catch AJAX calls on session-timeout?

2009-03-06 Thread MaD
i'm gonna try that. thanks! --~--~-~--~~~---~--~~ 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] Re: upload file to save

2009-03-06 Thread MaD
well, you got a few errors here and there. for example: path = File.join(directory, user.user_id, filename) i guess user doesn't have a user_id but an id, so try: path = File.join(directory, user.id, filename) if you post your error-message, we can try to get there step by step. but in

[Rails] Re: Association broken when upgrading from rails 1.2.6 to 2.2.2

2009-03-06 Thread MaD
in that view, does %= course.class % %= course.semester_id % give you something like this Course 32 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send

[Rails] Re: RoR for dummies .. from nothing to knowlege

2009-03-05 Thread MaD
# controller: def show_all_models # require all of your models so they get loaded Dir.glob(RAILS_ROOT + '/app/models/*.rb').each { |file| require file } # find all subclasses of ActiveRecord @all_models = Object.subclasses_of(ActiveRecord::Base) end # view: ul % @all_models.each do

[Rails] Re: change date and numbers format, before_validation()

2009-03-04 Thread MaD
since this problem is closely linked to your user's entries, you gotta solve it in your view or controller. to not repeat yourself too much you could add a helper-method for that piece of code you are using to set your records straight. --~--~-~--~~~---~--~~ You

[Rails] Re: Advanced Search In Ruby on Rails.

2009-03-04 Thread MaD
heavy interface you got there. still, without your code nobody will be able to tell you where you went wrong. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send

[Rails] Re: RoR for dummies .. from nothing to knowlege

2009-03-04 Thread MaD
i think your project is a pretty good start. if you are going to code it all by yourself, maybe even put your authentication-code into a plugin and in the end try to exchange it with sth. like restful_athentication, then you got your hands dirty enough to start a serious project. depending on

[Rails] Re: RoR for dummies .. from nothing to knowlege

2009-03-04 Thread MaD
oh, yeah i forgot: - be sure to test your app. either you use the built in test- framework or something like rspec. btw: it really doesn't matter which book your reading or which tutorial you are following. your approach of getting your hands dirty and trying to build a (not so trivial) app on

[Rails] Re: change date and numbers format, before_validation()

2009-03-04 Thread MaD
well, helpers are really meant for helping with displaying your data. thats right. i actually didn't mean to write a helper-method, but a method (in your controller) to help you with setting your records. my fault (got lost in translating my thoughts). i think your aproach of putting it into

[Rails] Re: change date and numbers format, before_validation()

2009-03-04 Thread MaD
well, you could always create a helper with an arbitrary name and include them in your controller. that way helpers are all huddled together in one folder, but that special controller_helper gets only included in controller that depend on it. --~--~-~--~~~---~--~~

[Rails] Re: No method error - nil object

2009-03-03 Thread MaD
your first aproach was this: def show @topic = @object @items = @topic.items end where would @object come from. it's a new uninitialized variable (= nil). that's the reason it didn't work. what else did you expect than nil.items ? --~--~-~--~~~---~--~~ You

[Rails] Re: empty file on upload

2009-03-03 Thread MaD
well, i did look at your code and answered. but still, do you really think people should search for your older posts to answer your latest one? your the one who wants some help, so try to supply as much information on your problem as possible...

[Rails] Re: upload file to save

2009-03-03 Thread MaD
for your view, if in doubt use this instead of %= f.file_field (uploaded_picture) % input type=file name=chosen_file / in your controller (the line you commented out): File.new(path, wb) { |f| f.write(params[:chosen_file].read) } if i didn't miss anything, this should do the trick.

[Rails] Re: Phone format in Rails

2009-03-02 Thread MaD
you could simply write your own helper like that: def format_phone_number(number) return (#{number[0..2]})#{number[3..5]}-{number[6..-1]} end add it to your view_helper and call it whenever you like. validations are similar. just add your own validation.

[Rails] Re: Simple Captcha setup problem

2009-03-02 Thread MaD
just install RMagick / ImageMagick (there should be a gem for this). --~--~-~--~~~---~--~~ 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

[Rails] Re: table lock

2009-03-02 Thread MaD
vendor/rails/activerecord/lib/active_record/locking/pessimistic: # Pass tt:lock = true/tt to ActiveRecord::Base.find to obtain an exclusive # lock on the selected rows: # # select * from accounts where id=1 for update # Account.find(1, :lock = true) # # Pass tt:lock =

[Rails] Re: How to Change Up Methods According to Parameter

2009-03-02 Thread MaD
# this makes param 2 and 3 optional (if none is passed default values are set to empty string): def check_chat_type(f, search_string_1=, search_string_2=) ... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on

[Rails] Re: Strange behavior of Source.column_names

2009-03-02 Thread MaD
i really can't answer your questions regarding why this happens, but for the HOW_TO part i'd suggest to just do it like this: # controller: @columns = Source.column_names # view: %= @columns % this respects MVC. --~--~-~--~~~---~--~~ You received this message

[Rails] Re: validates problem

2009-03-02 Thread MaD
can you set a debugger in your Controller/Model to see what is actually received? --~--~-~--~~~---~--~~ 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: table lock

2009-03-02 Thread MaD
That's a row lock :-) If you want a table lock you need to run the appropriate sql statement for your database by hand. Fred oh, i'm sorry. it seems i'm still a little bit sleepy and didn't read the question correctly. i thought you were looking for a row lock...

[Rails] Re: Scheduling in Ruby on Rails

2009-03-02 Thread MaD
it all depends on your machine. nobody can tell you what's right (or even the best) for you. you gotta decide for yourself. to show you some alternatives: - you could just work with cron-jobs. - you could use backgrounDRb or workling/starling to schedule your own processes.

[Rails] Re: empty file on upload

2009-03-02 Thread MaD
probably in row 23 of your code!? --~--~-~--~~~---~--~~ 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] Re: what / when calls create function in an ActionController ?

2009-02-28 Thread MaD
how can i know weather it is called or not set a debugger. --~--~-~--~~~---~--~~ 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

[Rails] Re: authentication and user management questions

2009-02-27 Thread MaD
at least that token-problem is solved. but it's still weird, cause that session_expiry code is actually working on one of my apps. are you sure you don't have some sort of typo? (sth. like instead of ) i would debug that piece of code to see, why the session is reset. btw: 1800 sec is of course

[Rails] Re: i18n with Rails 2.1

2009-02-27 Thread MaD
http://gems.rubyforge.vm.bytemark.co.uk/gems/actionmailer-2.2.2.gem that address seems to be working. have you tried it again? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to

[Rails] Re: simple select

2009-02-27 Thread MaD
the correct call is: @primary_photo = @gallery.photos.find(:first, :conditions = {:primary = true}) or (but thats an old one and i don't know if that isn't deprecated): @primary_photo = @gallery.photos.find_first_by_primary(true) --~--~-~--~~~---~--~~ You

[Rails] Re: simple select

2009-02-27 Thread MaD
or you could add a named_scope to your photo-model: named_scope :primary, :conditions = { :primary = true } then your call could be like: @primary_photo = @gallery.photos.primary.first this should be the nicest alternative. --~--~-~--~~~---~--~~ You received

[Rails] Re: simple select

2009-02-27 Thread MaD
well if you want all the primary photos just use my suggested named_scope. then you can ask: @all_primary_photos = Photo.all.primary # or just Photo.primary @all_galleries = Gallery.all no loop needed. but if you want to loop, you can do that with @all_galleries.each do |gallery| #

[Rails] Re: what / when calls create function in an ActionController ?

2009-02-27 Thread MaD
http://api.rubyonrails.com/classes/ActionView/Helpers/FormHelper.html example taken form the above link: # Note: a @person variable will have been created in the controller. # For example: @person = Person.new % form_for :person, @person, :url = { :action = create } do |f| % %=

[Rails] Re: authentication and user management questions

2009-02-25 Thread MaD
for your permissions problem I'd suggest the implementation of roles or groups. that way you can add users to groups or give them roles, which can be checked in a before_filter in your controllers. sessions: if you are using activerecordstore (and thus your sessions are saved in a db-table)

[Rails] Re: authentication and user management questions

2009-02-25 Thread MaD
I thought about creating groups, but then won't this complicate things? I'll have group_pages table, and how do I manage those? can a user belongs to many groups? it's actually best to create a many-to-many relationship (user habtm groups). there are many plugins outthere that provide just

[Rails] Re: Multiple rows in a model

2009-02-25 Thread MaD
in which line do you get the error? probably here: @child = Child.new(params[:child]) or here: @filter = Filtersetting.new(params[:filtersetting]) use the debugger (set it before that line) to see what's in your params-hash. there is probably a key like :1 = something then you can find

[Rails] Re: InvalidAuthenticityToken error with db sessions

2009-02-25 Thread MaD
i answered to this in your other thread... --~--~-~--~~~---~--~~ 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: can't activate activerecord since already activated

2009-02-24 Thread MaD
check installed gems, frozen rails in vendor and environment-entry for matching version. which rails version do you intend to use? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post

[Rails] Re: Capturing an IP Address

2009-02-24 Thread MaD
on your local machine it might give you the ip of your lan/intranet (from your router). on your server you get the external one given to you by your isp. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on

[Rails] Re: Add .html extension by default

2009-02-24 Thread MaD
how about a before/after_save callback? i guess that would work. --~--~-~--~~~---~--~~ 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

[Rails] Re: Add .html extension by default

2009-02-24 Thread MaD
sounds a little bit silly, bit i just tried a route like map.connect ':controller/:action.html' that is actually working for me http://localhost:3000/bla/index.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[Rails] Re: Cannot pass id field to ActiveRecord

2009-02-24 Thread MaD
you just have to set the primary key manually. @user = User.new(params[:user]) @user.username = params[:username] @user.save however for security reasons i would not advise to use mass-assignment for user-creation anyways. there could be stuff like that in there:

[Rails] Re: undefined method `model' for ContactController:Class

2009-02-24 Thread MaD
leave out the line model :contact you don't need that. --~--~-~--~~~---~--~~ 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

[Rails] Re: undefined method `model' for ContactController:Class

2009-02-24 Thread MaD
sorry i didn't read carefully enough. try this: rails project cd project script/generate scaffold contact name:string street:string mail:string nano config/database.yml rake db:migrate script/server firefox http://localhost:3000/contacts/new hope this helps. btw: the tutorial you

[Rails] Re: pass a varible from view to controller

2009-02-23 Thread MaD
basically you got two possibilities: 1. write the value into a session-variable session[:wtf] = some string or value 2. pass your value as a parameter to some action and read params in your controller: view: %= link_to my_action :controller = :bla, :action = :my_action, :wtf = some string

[Rails] Re: Textarea and line breaks

2009-02-23 Thread MaD
Sending again :) why? was 24 minutes of waiting too long? I hope now you can understand what my problem is. no, not really. anyhow: pJames, br /Andy, br /Candy/p this is actually what i thought you are trying to achieve after reading this: i used gsub method to replace \r\n to br/ now, i

[Rails] Re: Rating

2009-02-20 Thread MaD
Just check the link I posted earlier... --~--~-~--~~~---~--~~ 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: Rating

2009-02-20 Thread MaD
not explicitly. it is in fact a has_many relationship, because your model has_many :rates, but you dont need to write that. the only thing you have to write in your model is acts_as_rateable. but that's all in the example. --~--~-~--~~~---~--~~ You received this

[Rails] Re: Years gone by (deprecation of years method)

2009-02-20 Thread MaD
fractional years are no longer respected. convert to integers and use this instead: ActiveSupport::CoreExtensions::Integer::Time --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to

[Rails] Re: show/hide divs according to selection box

2009-02-20 Thread MaD
plain old javascript. if you don't know how to do it, google helps: http://www.webdeveloper.com/forum/showthread.php?t=122975 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to

  1   2   3   >