search for: koebb

Displaying 20 results from an estimated 23 matches for "koebb".

Did you mean: koebbe
2008 Jan 01
7
in_vertical_groups_of
Hi all, Here''s another contribution for anyone interested. In Railscast episode 28, Ryan Bates showed us in_groups_of which allows you to group array members such as >> list = [1, 2, 3, 4, 5, 6, 7] => [1, 2, 3, 4, 5, 6, 7] >> list.in_groups_of(3) => [[1, 2, 3], [4, 5, 6], [7, nil, nil]] This allows you to iterate over the groups and, for example, display a list
2008 Nov 03
17
SQL queries in Rails
Hi... I want to know the equivalent instructions to insert, update, search and delete a registry. I know Rails can do it easily Thanks to ActiveRecord, but here''s the catch: I''m using PostgreSQL. As I''m using SQL to do the migration (Including the foreign keys), I need to know if I can use SQL queries to do those actions. Is there an example out there? I uncommented
2008 May 06
12
Why before_filter is not working?
I have been scratching my head on this one for most of the day. Hopefully someone can help explain why before_filter isn''t working for my codes. In my Application controller, I have this: before_filter :login_required, :except => [:newacct, :create_newacct, :passwd_reset ] def login_required unless session[:user_id] flash[:notice] = "Please log in"
2008 Sep 17
13
Capturing the sql from a statement without executing it?
Hi guys, Is there an elegant way to capture the sql that would have been executed by an ActiveRecord statement, without actually executing it? :) I''m imagining something like sql = User.find(1).groups.to_sql or perhaps sql = ActiveRecord::Base.capture_sql { User.find(1).groups } resulting in sql = ''SELECT * FROM groups INNER JOIN memberships.... WHERE users.id =
2008 Jun 10
7
ActionMailer undefined method `parameters' - Rails 2.1
Hello Rubyists, I''m currently trying to get email hooked up via ActionMailer, and while I''ve gotten it to work in the past on Rails 1.2.x, I''m seeing an error that I''m unfamiliar with. Right now, I''m just trying to send email from my dev box via the SMTP server at work. My development.rb file: #...snip config.action_mailer.delivery_method = :smtp
2007 Dec 28
11
LIKE clause in rails
Hello, I am trying to achieve a search functionality in the following manner i have an table called people which has first_name,last_name,etc... After the user form to search people is submitted i get the params hash as params[:persons]={"first_name"=> "%John%","last_name"=>"%Stevens%"} NOTE : I have changed the params hash to include the %. Now
2008 Apr 04
6
validates_numericality_of :not_equal_to
I have a situation in which I want to validate a number is not zero. Both positive and negative values are acceptable, just not zero. validates_numericality_of has an :equal_to attribute, but I don''t see a :not_equal_to. I have not yet been able to find anyone who has discussed this. I did find information about custom validators, so I am now using a custom validator to check the field
2007 Dec 24
5
output link_remote_to in helper
Hi all, I have a complex link_remote_to link I need to generate often. I want to DRY up my view and create a helper that generates this link_remote_to for me. Is there a way my helper can output the link_remote_to javascript? Thanks STijn --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2008 Jul 28
1
Re: switching between projects?
pepa007 wrote: > Hi, > > sorry for newbie question: > > how do I switch between projects on command line? > > I know ''rails projectA'' creates projectA. but if I have another > projectB in another folder, how do I make this one active? > > Thank you By "active", I''m assuming you mean you want to see it in the web browser. When
2010 Jul 07
4
Haml ... ending a line with a | (vertical bar)
I don''t know if HAML questions are appropriate here ... but here goes. How does on end line to be rendered with a vertical bar (|) ? The vertical bar is a line continuation, aparently. Doing \| cause the vertical bar to be emitted ... as well as the backslash. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups
2007 Dec 09
5
Browserized Styles Plugin
Browserized Styles provides a dead simple way to create browser- specific CSS code for use in a Rails application. All you need to do is create a .css file targeted to a browser by appending an underscore and identifier to the end. === Installation === script/plugin install http://svn.intridea.com/svn/public/browserized_styles === Example === Let''s say I have some complex CSS code
2011 Apr 23
1
rake spec fails where rake spec:(models|controllers|views) pass
I''m still trying to work into Ruby 1.9.2 and am now experiencing something that makes no sense to me. Using rspec 1.3.2 and rspec-rails 1.3.4 with rails 2.3.11 on ruby 1.9.2-p180, when I $ rake spec:models they all pass. When I $ rake spec:controllers they all pass. When I $ rake spec:views they all pass. But when I $ rake spec I get <path to
2008 Sep 12
3
Help: A copy of ModelSecurity has been removed from the module tree but is still active!
Hi all, I''m posting this in the hope that someone who understands rails dependencies can shed some light. I''ve implemented a "ModelSecurity" module in the vein of Bruce Peren''s old ModelSecurity plugin (http://rubyforge.org/projects/model- security/). My ModelSecurity module lives in $RAILS_ROOT/lib. It is automatically included into ActiveRecord::Base by a
2007 Dec 27
17
2.0 & "Agile Web Dev..." book
Just running through the first little project (depot) in ''Agile Web Development with Rails''. It isn''t scaffolding like it says it should in the book. After running: >rails -d mysql depot then SQLing: drop table if exists products; create table products ( id int not null auto_increment, title varchar(100) not null, description text not null, image_url varchar(200)
2008 Sep 22
8
TimeZone daylight savings time problems
Here is the following from my console: >> Time.now => Mon Sep 22 11:33:34 +0200 2008 >> Time.now.utc_offset => 7200 >> TimeZone[Time.now.utc_offset] => #<TimeZone:0x11aea90 @tzinfo=nil, @utc_offset=7200, @name="Athens"> >> Time.now.in_time_zone(TimeZone[Time.now.utc_offset]) => Mon, 22 Sep 2008 12:34:22 EEST +03:00 (I am in Spain - CET - and
2010 Mar 04
5
has anybody made actionmailer work with rails 2.3.5?
Hi, I have wasted few days and I''m not getting anywhere. I was trying to follow tutorial on Rails Guides and this one: http://www.tutorialspoint.com/ruby-on-rails/rails-send-email.htm . All I need is to be able to send some text, nothing fancy. Why in Rails it has to be so difficult? Why it can''t be so simple as in PHP? Can anybody point me to some good simple tutorial,
2007 Dec 12
2
possible bug in eager loading
Hello, @users = User.find(:all, :include => {:user_data => :user_data_field}, :order => "username = ''someone-oHC15RC7JGTNLxjTenLetw@public.gmane.org'' desc", :limit => 50) This produces: User Load IDs For Limited Eager Loading (74.648762) SELECT * FROM (SELECT DISTINCT ON (users.id) users.id, username AS alias_0 FROM users LEFT OUTER JOIN
2007 Dec 28
4
Proper way for deploying many applications sharing a common user database
Hi, I know that it''s possible to use multiple databases with Rails. However most of the examples I have seen were for high availability. I would like to learn if anyone has any experience with a shared database among many rails applications. Such a case may make sense for shared user information. Any ideas? Thanks. -- Ersin Er --~--~---------~--~----~------------~-------~--~----~ You
2008 Jan 19
5
HAML makes me love and hate Python
I''m just a rails newbie, but I thought I would point out a small observation. About a year ago, I was having real trouble making the decision about whether I should learn Ruby or Python. I finally settled on Ruby, one of the reasons being that I didn''t want my language to tell me how whitespace should work. (Although the main reason was how object oriented Ruby is) Although
2007 Dec 23
11
return day from date (javascript) ?
Ok, I know this isn''t a Rails problem, but if you could help me out that''d be brill. I''ve used JavaScript to create a new Date object containing a date of my choice... mydate = new Date("11/24/2007"); //going with Javascript''s mm/dd/yyyy format now this is good, what i want to do now is put in an integer variable the number for the day, in this case