[Rails] Best way to generate static pages

2010-02-02 Thread ct9a
hi, guys I tried using Thoughtbot's High-Voltage to generate static pages in my app. For some reason, I can't seem to make it work cause it keeps redirecting to one of my search pages. Anyway, I can't seem to find more info in the documentation of high-voltage. There was some mention of "danger" i

[Rails] Re: Keeping a running count of user input

2010-02-02 Thread Dan Ci
Sharagoz -- wrote: > You can store it in a session variable to keep track across requests > session[:hole_number] = hole_number For the future reference of noobs like myself, this is how I did it. (For Agile Web Development with Rails readers, it's much easier than their Cart session would have

[Rails] Custom ActiveRecord finder invoking named scopes?

2010-02-02 Thread Erol Fornoles
I have a custom finder defined here: http://www.pastie.org/807187 Where search_by_date and search_by_text are named scopes, and eager is an eager-loading named scope defined as: named_scope :eager, :include => [{:container_inventory => {:container => [:size_type, :grade]}}, :company, :truck, :hau

[Rails] INDIGENIUS SOLUTIONS --- JOB IN ROR

2010-02-02 Thread Rails ROR
Hi, IndiGenius Solutions (www.indigenius.com)is a software company that has been serving many clients since 2004 till date. IndiGenius is now looking for bright, elegant, ROR developers. If interested, please post your updated resume to h...@indigenius.com Best Wishes!! IndiGenius Solutions w

[Rails] Toggling effect

2010-02-02 Thread Charanya Nagarajan
Hi all, I have a list of links in a page,i have toggling effect associated with them <%= link_to_function("#{article.title}", nil ) do |page| page.visual_effect :toggle_blind, "article_content_#{article.id}" end %> The Number of links is dynamic. Now if i click on link1 the div associated with it

[Rails] Re: QUERY HELP

2010-02-02 Thread Marnen Laibow-Koser
Newb Newb wrote: > > > I have a table named logs. > > it has sender,receivers fields. > > my sample data from my table > > id sender receivers > 11 2,3 > 22 3 > 31 3,2 > > Very bad. Don't try to store multiple values in one field, or you'll run into

[Rails] QUERY HELP

2010-02-02 Thread Newb Newb
I have a table named logs. it has sender,receivers fields. my sample data from my table id sender receivers 11 2,3 22 3 31 3,2 when i execute the below query "select * FROM logs where sender = 1 and receiver IN (2)" i get only one record .the id is 1

[Rails] Re: Nested Rails Views

2010-02-02 Thread Marnen Laibow-Koser
Raymond O'Connor wrote: > Marnen Laibow-Koser wrote: >> Raymond O'Connor wrote: >>> I'm at the point where I have a lot of view files for each controller in >>> my app. >> >> Why do you have so many? It's rare to have more than about 5 views per >> controller. >> >>> I'd like to be able to add

[Rails] Re: Embedding New Line Character in XML Spreadsheet (Excel)

2010-02-02 Thread Piyush with Rails
Yes.i have tried putting 10.chr as as below xml.Row 'ss:StyleID' => 's65' do xml.Cell 'ss:StyleID' => 's70' do xml.Data "test" + 10.chr + "test 3", 'ss:Type' => 'String' end end But it is putting a space instead of a line break. Thanks, Piyush On Feb 1, 2:14 pm,

[Rails] customizing validation msg

2010-02-02 Thread M I R
Hi, i am using the default validation of RoR how i will customize them i dont want to display the default message but i want to print the message i want like for city_id the default message is "City can't be blank" i want this message as "Please enter city" Regards -- You received this message be

[Rails] Re: Preserving has_many order

2010-02-02 Thread MarkB
Thanks everyone for the recommendations. :order looks like an easy way to get started. I'll go with that and see if any optimizations are needed down the road. On Feb 2, 12:37 am, Frederick Cheung wrote: > On Feb 2, 5:26 am, MarkB wrote: > > > I would like the measurements to be kept in the or

Re: [Rails] assert_equal Test - how to test updates

2010-02-02 Thread vihrao
assert_equal uses the == method to compare the two objects, and == on activerecord doesn't compare attributes: it only compares the id of the object (ie do the compared objects represent the same row in the database) Fred -- That is why I had this issue. I had two fixtures users.yml and gusers

[Rails] Re: restful plugin with session table

2010-02-02 Thread Preksha Patel
Milan Dobrota wrote: > If you go to console and try to create session objects what happens? > > Milan Dobrota > http://www.milandobrota.com thanks for your reply..session's object is cretaed and there is a database entry in session table.. -- Posted via http://www.ruby-forum.com/. -- You rece

[Rails] Re: Nested Rails Views

2010-02-02 Thread Raymond O'Connor
Marnen Laibow-Koser wrote: > Raymond O'Connor wrote: >> I'm at the point where I have a lot of view files for each controller in >> my app. > > Why do you have so many? It's rare to have more than about 5 views per > controller. > >> I'd like to be able to add another level or two of directori

[Rails] Re: Nested Rails Views

2010-02-02 Thread Marnen Laibow-Koser
Raymond O'Connor wrote: > I'm at the point where I have a lot of view files for each controller in > my app. Why do you have so many? It's rare to have more than about 5 views per controller. > I'd like to be able to add another level or two of directories > in my view folders just for organiz

[Rails] Nested Rails Views

2010-02-02 Thread Raymond O'Connor
I'm at the point where I have a lot of view files for each controller in my app. I'd like to be able to add another level or two of directories in my view folders just for organizational purposes. What's the best way to do this? i.e. app/views/controller/sub_dir/view.html.erb -- Posted via htt

[Rails] Does session_secure work?

2010-02-02 Thread Cynthia Kiser
I am trying to get session cookies set so they are only returned over ssl connections. I looked in AWDWR and see there is a parameter :session_secure. The book says 'If true, sessions will be enabled only over https://' The example code in that section of the book shows: class ApplicationControlle

[Rails] Re: Generating a PDF using popen and wkhtmltopdf

2010-02-02 Thread Nicolas Rimbeau
Thanks for your answer Jeff. I'll give it a try in my own app and see whether it's working or not. I'll keep you posted! Cheers, - Nicolas -- 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 po

Re: [Rails] Re: Re: Re: sqlite to mysql

2010-02-02 Thread Hassan Schroeder
On Tue, Feb 2, 2010 at 3:44 PM, Ichiro Saga wrote: > It works!  Thanks Hassan.  But still not sure why sqlite3 has > "varchar(255)" as well.  Maybe that's not the real length of the field. Apparently that's just a serving suggestion in SQLite3 -- it doesn't even issue a warning; MySQL does :-)

[Rails] Re: Re: Re: sqlite to mysql

2010-02-02 Thread Ichiro Saga
Ichiro Saga wrote: > Hassan Schroeder wrote: >> On Tue, Feb 2, 2010 at 2:43 PM, Ichiro Saga >> wrote: >> >>> under Type, it's "varchar(255)" >> >> So if you want to store more than 255 characters, as you indicated >> earlier, you need to change that field :-) >> >> Not too surprising, eh? >>

[Rails] Re: Re: Re: sqlite to mysql

2010-02-02 Thread Ichiro Saga
Hassan Schroeder wrote: > On Tue, Feb 2, 2010 at 2:43 PM, Ichiro Saga > wrote: > >> under Type, it's "varchar(255)" > > So if you want to store more than 255 characters, as you indicated > earlier, you need to change that field :-) > > Not too surprising, eh? > > -- > Hassan Schroeder --

Re: [Rails] Re: Re: sqlite to mysql

2010-02-02 Thread Hassan Schroeder
On Tue, Feb 2, 2010 at 2:43 PM, Ichiro Saga wrote: > under Type, it's "varchar(255)" So if you want to store more than 255 characters, as you indicated earlier, you need to change that field :-) Not too surprising, eh? -- Hassan Schroeder hassan.schroe...@gmail.com t

[Rails] captcha installation

2010-02-02 Thread Vishwa Rao
I am running XP. Downloaded simple captch from expressica, unzipped into vendor/plugin. Ran >rake simple_captcha:setup. Gives me error: rake aborted! don't know how to build task 'simple captcha:setup_old' I checked rails version by >gem list rails Gives me rails <2.3.5, 1,2,2> can someone tell me

[Rails] Re: Re: sqlite to mysql

2010-02-02 Thread Ichiro Saga
Hassan Schroeder wrote: > On Tue, Feb 2, 2010 at 2:08 PM, Ichiro Saga > wrote: > >>> Your MySQL field definitions obviously don't match the data you're >>> trying to store there. > >> both have the same problem mentioned in the previous post. > > Somewhat surprising, but still -- if it's wrong

[Rails] Re: how to generate parameters similar to a form

2010-02-02 Thread ct9a
hello, Philip, Yes, it worked like a charm and it makes sense! <%= link_to 'test', root_path(:search => {:one => 1, :two => 2}) %> Perfect! thank you :) Call closed :) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to thi

[Rails] Re: View Helper Scope

2010-02-02 Thread Michael Schuerig
On Tuesday 02 February 2010, Marnen Laibow-Koser wrote: > Michael Schuerig wrote: > > On Monday 01 February 2010, Marnen Laibow-Koser wrote: > >> strings. > > > > Let's just leave it at that and acknowledge that our views differ. > > I really would rather not leave it there. If I'm doing things

[Rails] Admin Backend Metrics

2010-02-02 Thread David
Im interested in hearing any advice/tips on what or how to build an effective administrative backend for monitoring user input and actions while on my site. Some of the metrics that I've read or heard about that can be useful are: -all user inputs for any field -tracking user movement and actions

Re: [Rails] Re: sqlite to mysql

2010-02-02 Thread Hassan Schroeder
On Tue, Feb 2, 2010 at 2:08 PM, Ichiro Saga wrote: >> Your MySQL field definitions obviously don't match the data you're >> trying to store there. > both have the same problem mentioned in the previous post. Somewhat surprising, but still -- if it's wrong, it's wrong. What does `show create tab

Re: [Rails] how to generate parameters similar to a form

2010-02-02 Thread Philip Hallstrom
hi guys, i have a search form set up which points to my search controller. When I hit "submit" in the form, it activates the perform_search method in my search controller. It works ok. A typical GET request that is performed would look like this: http://my-test-box.local:3000/search? search[c

[Rails] Re: sqlite to mysql

2010-02-02 Thread Ichiro Saga
Hassan Schroeder wrote: > On Tue, Feb 2, 2010 at 11:36 AM, Ichiro Saga > wrote: >> Hi, there. I have an application running with sqlite in development mode >> and production mode. �I just installed mysql on windows and created a >> new database in mysql for the application in development mode. >

[Rails] Re: has_many, through with nested models?

2010-02-02 Thread lunaclaire
Thx, Colin. I didnt see your reply, but I got a very similar answer today on StackOverflow: http://stackoverflow.com/questions/2187430/how-to-define-a-named-scope-to-roll-up-a-has-many-with-nested-models/2187447#2187447 Basically, it looks like this: class Forum < ActiveRecord::Base has_many :

[Rails] Rs 20,000 INR at stake in CodeWarrior

2010-02-02 Thread ankit choudhary
CodeFest & IEEE present to you CodeWarrior - Either Win or Die Coding! It is a *completely Online* event with two cumulative rounds, testing all aspects of your computer knowledge, be it programmi

[Rails] [Security] [ANN] Loofah has an HTML injection / XSS vulnerability, please upgrade to 0.4.6

2010-02-02 Thread Mike Dalessio
Synopsis -- Loofah::HTML::Document#text emits unencoded HTML entities prior to 0.4.6. This was originally by design, since the output of #text is intended to be used in a non-HTML context (such as generation of human-readable text documents). However, Loofah::XssFoliate's default behavior

[Rails] how to generate parameters similar to a form

2010-02-02 Thread ct9a
hi guys, i have a search form set up which points to my search controller. When I hit "submit" in the form, it activates the perform_search method in my search controller. It works ok. A typical GET request that is performed would look like this: http://my-test-box.local:3000/search?search[cat

[Rails] Re: assert_equal behavior

2010-02-02 Thread Jeff
On Feb 2, 9:58 am, Vishwa Rao wrote: > I am testing with assert_equal > > Here is my Fixture: > bob1: >   id: 101 >   login: bob >   glogin: b...@mcbob.com >   session_token: 77a38 # test > > Here is my Test method: > class Guser < ActiveRecord::Base >   attr_accessor :session_token >   def se

Re: [Rails] sqlite to mysql

2010-02-02 Thread Hassan Schroeder
On Tue, Feb 2, 2010 at 11:36 AM, Ichiro Saga wrote: > Hi, there. I have an application running with sqlite in development mode > and production mode.  I just installed mysql on windows and created a > new database in mysql for the application in development mode. > Did I miss something? Your MyS

[Rails] Re: set_table_name not working in 2.3.5

2010-02-02 Thread Grant Gray
I found the problem. All items concerned should be in the model and not the controller. You can read about it on my blog if you need help with multiple databases and the like. http://mygrantness.blogspot.com/2010/02/multi-databasess-for-rails.html Thanks Fred for the help. -- Posted via http:

[Rails] Re: Generating a PDF using popen and wkhtmltopdf

2010-02-02 Thread Jeff Lewis
(reposted due to typo... ) Hi Nicolas, Whenever I generate pdfs from a rails app using wkhtmltopdf (or princexml), I usually call wkhtmltopdf using an app_url (ie wkhtmltopdf hits the web app to get the html/css/imgs/... to be used to gen the pdf), something like the following: # in some contr

Re: [Rails] Install a separate set of gems...

2010-02-02 Thread Conrad Taylor
On Tue, Feb 2, 2010 at 2:08 PM, jiggy wrote: > I run a small RoR application on a company server. I try to install > my own list of gems because I would like to test new features, but the > admin did not want to install these because these may disrupt other > applications. Since I know that I ca

[Rails] Re: Generating a PDF using popen and wkhtmltopdf

2010-02-02 Thread Jeff Lewis
Hi Nicolas, Whenever I generate pdfs from a rails app using wkhtmltopdf (or princexml), I usually call wkhtmltopdf using an app_url (ie wkhtmltopdf hits the web app to get the html/css/imgs/... to be used to gen the pdf), something like the following: # in some controller require 'timeou

[Rails] Re: Install a separate set of gems...

2010-02-02 Thread Jiggy Jiggy
Marnen Laibow-Koser wrote: > Jiggy Jiggy wrote: >> I run a small RoR application on a company server. I try to install >> my own list of gems because I would like to test new features, but the >> admin did not want to install these because these may disrupt other >> applications. Since I know that

Re: [Rails] assert_equal Test - how to test updates

2010-02-02 Thread vihrao
On Feb 2, 5:55 pm, vihrao wrote: > > Then I run it again by changing the method argument like this to update > the > sesison token >  assert_equal �...@bob1, Guser.update_token("b...@mcbob.com", "bob", > "77a138") > It still gives a success message: 1 tests, 1 assertions, 0 failures, 0 > erro

[Rails] sqlite to mysql

2010-02-02 Thread Ichiro Saga
Hi, there. I have an application running with sqlite in development mode and production mode. I just installed mysql on windows and created a new database in mysql for the application in development mode. After putting some data in database, I found that I can't save Time object like 'Tue Feb 01

Re: [Rails] Re: /!\ FAILSAFE /!\ error with Rails 2.3.4

2010-02-02 Thread Tom Rossi
Interesting! I've found the problem, but not the fix. I was store my ActiveRecord errors in the flash as shown below: flash.now[:errors]= @object.errors This apparently causes problems when you are using PaperClip and there is a validation issue. It may be trying to put the file in the ActiveR

[Rails] Re: Install a separate set of gems...

2010-02-02 Thread Marnen Laibow-Koser
Jiggy Jiggy wrote: > I run a small RoR application on a company server. I try to install > my own list of gems because I would like to test new features, but the > admin did not want to install these because these may disrupt other > applications. Since I know that I can install some gems locally

[Rails] Re: render :action => 'new' renders a blank page

2010-02-02 Thread DBA
> Are you sure the problem isn't a few lines further up ? If either of > those return false statements are triggered then save won't yield to > its block. Would it not be simpler to use the return value from save > rather than this block approach? > The block approach was originally implemented b

[Rails] Re: ActionMailer using wrong layouts on prod box

2010-02-02 Thread Josh
Few updates to the original post: I've since changed the layouts to "notifier_layout" in case there was some conflict with "email" -- as didn't fix it (as expected) I tested it with ERB and a barebones rails 2.3.5 app -- so yea, not Rails and not Haml's fault On prod Notifier.instance_variable_g

[Rails] ActionMailer using wrong layouts on prod box

2010-02-02 Thread Josh
Using ActionMailer, Haml and multi part emails I'm seeing very strange behavior on one particular production box. I've got: class Notifier < ActionMailer::Base layout 'email' def test end end All of these files exist: app/views/notifier/test.text.html.haml app/views/notifier/test.text.pla

[Rails] Install a separate set of gems...

2010-02-02 Thread jiggy
I run a small RoR application on a company server. I try to install my own list of gems because I would like to test new features, but the admin did not want to install these because these may disrupt other applications. Since I know that I can install some gems locally in my own machine, I ask th

[Rails] Re: Conditions parameter for find

2010-02-02 Thread joshmc...@gmail.com
You can also use: @dudes = Dude.find(:all, :conditions => {:category_id => category_id}) On Feb 2, 12:28 am, Marnen Laibow-Koser wrote: > Sean Six wrote: > > category_id = params[:category_id] > > > @dudes = Dude.find(:all, > >  :conditions => ["category_id = ?", category_id]) > > > This is retur

[Rails] Re: render :action => 'new' renders a blank page

2010-02-02 Thread Frederick Cheung
On Feb 2, 5:00 pm, DBA wrote: > However, when the openid_identifer validation kicks in, something in > the "supper" is preventing the render :action => 'new' set in the > controller for when the result is not "true". > > I'm a bit new on this kind of issues, so bare with me on this > eventually

[Rails] Re: /!\ FAILSAFE /!\ error with Rails 2.3.4

2010-02-02 Thread Frederick Cheung
On Feb 2, 6:33 pm, TomRossi7 wrote: > Does anyone know what could be causing this error?  I am currently > experiencing it when some browser submit a multipart form witha file > attached. > Somewhere you are trying to serialize a Proc object (looks like you're trying to put one in the session).

[Rails] Re: assert_equal Test - how to test updates

2010-02-02 Thread Frederick Cheung
On Feb 2, 5:55 pm, vihrao wrote: > > Then I run it again by changing the method argument like this to update the > sesison token >  assert_equal �...@bob1, Guser.update_token("b...@mcbob.com", "bob", "77a138") > It still gives a success message: 1 tests, 1 assertions, 0 failures, 0 > errors, 0 s

[Rails] /!\ FAILSAFE /!\ error with Rails 2.3.4

2010-02-02 Thread TomRossi7
Does anyone know what could be causing this error? I am currently experiencing it when some browser submit a multipart form witha file attached. Thanks! Tom /!\ FAILSAFE /!\ Tue Feb 02 13:28:35 -0500 2010 Status: 500 Internal Server Error no marshal_dump is defined for class Proc /opt/r

[Rails] Re: assert_equal behavior

2010-02-02 Thread Frederick Cheung
On Feb 2, 3:58 pm, Vishwa Rao wrote: > > I expected the test to fail as there was no record in the database and > the 'find' should return nothing. But it creates a new one and the test > is a success. I do not see any code for creating new record or save. So > why is it creating a new record? >

Re: [Rails] assert_equal Test - how to test updates

2010-02-02 Thread vihrao
I meant it does not update the value from '77a38' to '77a138' vihrao wrote: > > I am testing an update via assert_equal and it does not seem to work. > > I have this fixture: > bob1: > id: 101 > login: bob > glogin: b...@mcbob.com > session_token: 77a38 > > Here is my test method:

[Rails] assert_equal Test - how to test updates

2010-02-02 Thread vihrao
I am testing an update via assert_equal and it does not seem to work. I have this fixture: bob1: id: 101 login: bob glogin: b...@mcbob.com session_token: 77a38 Here is my test method: class Guser < ActiveRecord::Base def self.update_token(glogin, login, stoken) u=find(:first, :

[Rails] Problem with interlock and memcache-client

2010-02-02 Thread Max Williams
hey all I have interlock and memcache working fine in one rails app. I'm starting another and can't get it working - when i try to run a test for example i get no such file to load -- memcache-client ...list of rubygems require error trace messages /vendor/plugins/interlock/lib/interlock/config.

[Rails] render :action => 'new' renders a blank page

2010-02-02 Thread DBA
Hello, Even though I'm quite a newbie in Ruby and Ruby on Rails, I've been trying to fix Binarylogic's authlogic-openid gem, over on http://github.com/DBA/authlogic_openid, which is current version is incredibly outdated due to the upgrades made to the rails/ open_id_authentication plugin. So far

[Rails] Action Caching and After Filters

2010-02-02 Thread Luke Cowell
Hi there, I'm using action caching, instead of page caching, because I'm using filters in my controller. class CommunityProgramController < ApplicationController before_filter :login_required after_filter :log_request caches_action :show In the log: Cached fragment hit: views/site.com/

[Rails] assert_equal behavior

2010-02-02 Thread Vishwa Rao
I am testing with assert_equal Here is my Fixture: bob1: id: 101 login: bob glogin: b...@mcbob.com session_token: 77a38 # test Here is my Test method: class Guser < ActiveRecord::Base attr_accessor :session_token def self.match_login(glogin, login, ses_token) u=find(:first, :c

[Rails] Re: How to parse rendered html page

2010-02-02 Thread Marnen Laibow-Koser
parkurm wrote: > I'm trying to write a website that parses all images in a given > webpage. I initially tried to get all image links by looking for > tag, by using nokogiri html parser, and it works well with webpages > without javascript. > > Some pages use javascript to render the view, and usi

[Rails] Re: Preserving has_many order

2010-02-02 Thread Marnen Laibow-Koser
Robert Walker wrote: > Frederick Cheung wrote: >> On Feb 2, 5:26�am, MarkB wrote: >>> a has_many relationship? >>> >> >> You should add an order clause to your has_many, without one the >> database is free to return rows in any order it pleases. This >> shouldn't be a performance issue as long as

[Rails] Re: sqlite3.dll??

2010-02-02 Thread Aldric Giacomoni
Afg Afg wrote: > I am running windows xp. I also have aptana and mysql installed. > > The problem is that when i try to go and view my project from browser it > says " sqlite3.dll was not found, blah blah. I don't sqlite3.dll since i > am using mysql for my databases. > > What can i do to fix thi

[Rails] Re: Preserving has_many order

2010-02-02 Thread Robert Walker
Frederick Cheung wrote: > On Feb 2, 5:26�am, MarkB wrote: >> a has_many relationship? >> > > You should add an order clause to your has_many, without one the > database is free to return rows in any order it pleases. This > shouldn't be a performance issue as long as you have appropriate > indexe

[Rails] Re: can't have webrick come up

2010-02-02 Thread beny 18241
There are 2 options change port to other ruby script/server -p3001 or disable some firewall cheers kevid wrote: > hi > I can't have webrick run. i get the error below; someone help. > C:\>cd alumsimport1 > > C:\alumsimport1>ruby script/server > => Booting WEBrick > => Rails 2.3.5 appli

[Rails] Re: Problem on running rails

2010-02-02 Thread Mauricio Voto
Just to remember, on windows, mysql and rails 2.2 has a conflict: http://www.sapphiresteel.com/Rails-2-2-and-MySQL-Problems See ya ! On 2 fev, 10:04, kannav rajeev wrote: > then error ? print that here... > > On Tue, Feb 2, 2010 at 5:27 PM, kannav rajeev > wrote: > > you may use instant rails

[Rails] can't have webrick come up

2010-02-02 Thread kevid
hi I can't have webrick run. i get the error below; someone help. C:\>cd alumsimport1 C:\alumsimport1>ruby script/server => Booting WEBrick => Rails 2.3.5 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2010-02-03 12:44:25] INFO WEBrick 1.3.1 [2

[Rails] Active Scaffold configuration

2010-02-02 Thread beny 18241
Hi I have simple question.. When I'am adding following code to controller.New one, just generated, next ActiveScaffold installed. - config.action_links.add :edit. :label => 'Comment', :page => false, :type => :record - According to offical info i should add action_link, but

[Rails] How to parse rendered html page

2010-02-02 Thread parkurm
I'm trying to write a website that parses all images in a given webpage. I initially tried to get all image links by looking for tag, by using nokogiri html parser, and it works well with webpages without javascript. Some pages use javascript to render the view, and using nokogiri, I'm just getti

[Rails] Re: restful plugin with session table

2010-02-02 Thread milandobrota
If you go to console and try to create session objects what happens? Milan Dobrota http://www.milandobrota.com On Feb 2, 10:30 am, Preksha Patel wrote: > hi, > > I want to use this plugin with sessions table with configuration in > environment.rb > > config.action_controller.session_store = :act

[Rails] Re: reservation system for hotel

2010-02-02 Thread milandobrota
I would put both start date and end date. That could simplify the calculations a little. Milan Dobrota http://www.milandobrota.com On Feb 2, 10:12 am, adrianb wrote: > > Your question isn't really a Rails question, but a good way to do this   > > would be to have a bookings model and an inventor

[Rails] Re: chunks of form

2010-02-02 Thread Sharagoz --
Cant you just render more than one partial within the same form like <% form_for(@stuff) do |f| %> <%= render(:partial => 'chunk1', :locals => {:f => f}) %> <%= render(:partial => 'chunk2', :locals => {:f => f}) %> <%= f.submit('Done') %> <% end %> ? -- Posted via http://www.ruby-forum.com/.

[Rails] Re: Best way to connect various applications?

2010-02-02 Thread Amar Daxini
Heinz Strunk wrote: > Rails Engines sounds indeed very interesting. I'll check the screencast. > Thanks! I have similar issue as you as so i modify some part of engine and each application has different database if you has single user db not a problem just you remove user migration from and user

[Rails] Problem on running rails

2010-02-02 Thread mohit
Hi All I am facing the problem on running rails I found devlopment with following error /!\ FAILSAFE /!\ Tue Feb 02 14:52:32 +0530 2010 Status: 500 Internal Server Error no such file to load -- mysql C:/RubyInst/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 31:in `gem_original_requi

[Rails] Re: Keeping a running count of user input

2010-02-02 Thread Dan Ci
>You can store it in a session variable to keep track across requests >session[:hole_number] = hole_number Thanks. I'm sure I'll find a way to mess that up. Marnen Laibow-Koser wrote: > That's a *very bad* user interface. The app should not force entry of > holes in a particular order. Why no

[Rails] chunks of form

2010-02-02 Thread M I R
is there any way so that i can divide my form into small chunks and then include it with render partial -- 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] Re: Find_by

2010-02-02 Thread RubyonRails_newbie
Thanks for the response. Slightly more complex than I'd hoped, but certainly makes sense. Many thanks! On 2 Feb, 09:45, Peter Hickman wrote: > Mm. The problem here is that your problem has little if anything to do with > Rails or Ruby even. > > You have a database with a list of users and some

[Rails] restful plugin with session table

2010-02-02 Thread Preksha Patel
hi, I want to use this plugin with sessions table with configuration in environment.rb config.action_controller.session_store = :active_record_store and rake db:sessions:create rake db:migrate but strange its not allowing me to login. and if I remove configuration from environment.rb its workin

[Rails] Re: Active scaffold multiple edit links

2010-02-02 Thread beny 18241
Hi Well, I have antoher question.I've just added def comm to controller class HomeController < ApplicationController active_scaffold :home do |config| config.action_links.add :comm, :label => 'Comment', :page => false, :type => :record config.action_links.add :about, :label => '--Contact--'

[Rails] Re: reservation system for hotel

2010-02-02 Thread adrianb
> Your question isn't really a Rails question, but a good way to do this   > would be to have a bookings model and an inventory model. > > The rooms are 'inventory'. Their selling price is in the inventory   > model. Dynamic changes can take place to the inventory while retaining   > previously boo

[Rails] Re: Find_by

2010-02-02 Thread RubyonRails_newbie
No - sorry my poor explanation.. I have a site that people can join and add friends. I want to add a feature that suggests friends for them. So – for example user X has registered and filled in details such as ‘current location’ = London Fav Movie = ‘Avatar’ etc I’d like to be able to then use

[Rails] Re: Preserving has_many order

2010-02-02 Thread Frederick Cheung
On Feb 2, 5:26 am, MarkB wrote: > I would like the measurements to be kept in the order in which they > are taken and stored in the database so that a potentially expensive > sorting operation is not required every time the user queries a > location's temperature history. > > If I implemented th

[Rails] Need shopping cart for social Rails app - Spree vs substruct vs roll my own

2010-02-02 Thread J Wow
Hi all, I'm building what could best be described as a variant of Threadless.com. Basically, it's a social app that requires some non- trivial social capabilities, combined with a shopping area for making purchases of specific crowd-sourced products. I'd like to make the transition between the two

[Rails] Preserving has_many order

2010-02-02 Thread MarkB
My application will need to store many measurements (eg: temperature) for a set of locations (eg: roof) and periodically recall those measurements for charting, browsing, or editing. class Location < ActiveRecord::Base has_many :Measurements end class Measurement < ActiveRecord::Base belongs_

[Rails] Browsing nested models

2010-02-02 Thread Jonas
Hi all, Beginner's question here: I've wondered, why I can't browse through "nested" models (belongs_to/has_many). My models: (http://gist.github.com/291956) class Enterprise < ActiveRecord::Base has_many :branches has_many :people, :through => :branches end class Branch < ActiveRecord:

[Rails] How to set RUBY EXECUTABLE path in Ruby Gems Environment

2010-02-02 Thread nu
I have ruby 2 version in my Mac which are 1.8.6 and 1.8.7. I would like to set Rubygems environment to point to Ruby 1.8.7. Anyone know this issure ubyGems Environment: - RUBYGEMS VERSION: 1.3.5 - RUBY VERSION: 1.8.6 (2008-08-11 patchlevel 287) [universal- darwin9.0] - INSTALLATION DIRE

[Rails] Re: Rails and Merb session key and secret

2010-02-02 Thread Frederick Cheung
On Feb 2, 12:55 am, NY wrote: > Although in the future they will probably be in two different sub > domains, currently I'm experimenting both under localhost, with > different ports. > > And another interesting problem is that, though the two apps are not > reading each others' session data, set

[Rails] Re: set_table_name not working in 2.3.5

2010-02-02 Thread Frederick Cheung
On Feb 2, 6:40 am, Grant Gray wrote: > Frederick Cheung wrote: > > That's weird - Why are you not calling set_table_name / > > set_primary_key on some subclass of ActiveRecord::Base ? > > > Fred > > Hi Fred, > > I dont understand what you mean? Can you elaborate? I had it working > before under