[Rails] Re: Is it possible to temporary cache an attribute's value in memory or do something similar?

2010-06-01 Thread Frederick Cheung
On Jun 2, 12:18 am, Matthew Hillsborough wrote: > Is there anyway to work around this condition and temporarily set the > in_use attribute to 1 for subsequent iterations of the loop so that I > retrieve an available bar instance? > Well if things do need to be atomic then you probably want to w

[Rails] Re: Element.insert_html is not function

2010-06-01 Thread Venu Gopal
Hi, I inserted required java script files in my html page that is new.html.erb Plaese verify the file... #Projects/new.html.erb <% form_for :project, :url => projects_path do |f| %> Name: <%= f.text_field :name %> <%= render :partial => 'task', :collection => @project.t

[Rails] Re: Only display 5 items at a time with more button

2010-06-01 Thread Matenia Rossides
there is a function called in_groups_of .. there is a railscast episode about it. I have used a manual scrolling slider similar to what you want at the bottom of http://www.conikitv.com/ where it will grab the first hundred videos and display them in groups of 10 using the slider. Basically the th

[Rails] Open Source Contribution

2010-06-01 Thread Guilherme Guimarães
Hi. After some reading and coding samples i'm looking for a real ROR open- source project to contribute. Does anybody need help? Regards, Guilherme Guimarães -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, sen

[Rails] Re: Ruby on Rails installation issue

2010-06-01 Thread Eugene Wolfson
Thank you! That worked. P.S. used the tutorial for Mac OS X at: http://accidentaltechnologist.com/ruby-on-rails/setting-up-sqlite3-for-ruby-on-rails-development/ John T. wrote: > Eugene Wolfson wrote: >> Hello everyone. I am new to Rails (and Ruby) and when I was going >> through the example in

[Rails] Re: Authorize AASM state transitions with Declaraive_Authorization ?

2010-06-01 Thread TINODEV
Thank you Brian.. I understand :) Will keep trying or try other alternatives as well.. Still hoping to get some more suggestions here.. tino. On Jun 1, 11:41 pm, "Brian V. Hughes" wrote: > Unfortunately, as you can tell from my original message, I'm a   > state_machine user, not an aasm user. N

[Rails] click the address to display google map

2010-06-01 Thread Guo Yangguang
hi My app has location for every user,i want the location to display a little google map in a way like ajax when clicking the location? I am a javascript and google map api idiot,can you help me? is there any tutorial? I have looked over the goog map api,but can not find the answer. Thanks! --

[Rails] Re: Starting Mongrel failes on Mac OS 10.6

2010-06-01 Thread Gregor
On 2 Jun., 02:10, Hassan Schroeder wrote: > On Tue, Jun 1, 2010 at 4:38 PM, Gregor wrote: > > Sorry for that, but first I gone the wrong way and after some hours I > > noticed how easy it is to install rails.. I use the command "ruby > > script/server". How do I see if webrick starts? > > prompt%

Re: [Rails] Re: Starting Mongrel failes on Mac OS 10.6

2010-06-01 Thread Hassan Schroeder
On Tue, Jun 1, 2010 at 4:38 PM, Gregor wrote: > Sorry for that, but first I gone the wrong way and after some hours I > noticed how easy it is to install rails.. I use the command "ruby > script/server". How do I see if webrick starts? prompt% script/server webrick > Output of "gem list --local

[Rails] Re: Starting Mongrel failes on Mac OS 10.6

2010-06-01 Thread Gregor
On 1 Jun., 23:50, Hassan Schroeder wrote: > On Tue, Jun 1, 2010 at 1:19 PM, Gregor wrote: > > after spending some hours on installing ruby on rails, I passed the > > point to start my server. > > "hours"? That doesn't sound promising :-) > > > But mongrel failed to start with the following messa

[Rails] Is it possible to temporary cache an attribute's value in memory or do something similar?

2010-06-01 Thread Matthew Hillsborough
Hello, I have a bit of code that depicts this hypothetical setup below. A class Foo which contains many Bars. Bar belongs to one and only one Foo. At some point, Foo can do a finite loop that lapses 2+ iterations. In that loop, something like the following happens: bar = Bar.find_where_in_use

[Rails] One account several users with different privileges

2010-06-01 Thread Cristian Dlucca
My app needs to have an account with several users inputting tasks on the same account. Only one of the users (the one that opened the account) will have admin privileges. I'm thinking on using Authlogic for authentication and CanCan for determining user privileges. The point is that I'd like the

[Rails] Re: Ruby on Rails + Flash Application ?

2010-06-01 Thread John Ivanoff
flash and rails . . . Flexible Rails Flex 3 on Rails 2 http://www.manning.com/armstrong/ I used to use instant rails but dropped that a while ago. I develop on windows :-/ I wrote post on windows and rails installation. http://johnivanoff.blogspot.com/2010/03/new-ruby-on-rails-setup-on-windo

[Rails] Re: Ruby on Rails + Flash Application ?

2010-06-01 Thread Marnen Laibow-Koser
TINODEV wrote: > Hello, > > I'm a Ruby on Rails beginner, as well as Flash beginner.. > Recently started developing a Web application using Ruby on Rails > (I'm using InstantRails on Windows..).. > Few days ago the Application's design was changed and now the > requirement is a Flash-based Web App

Re: [Rails] Starting Mongrel failes on Mac OS 10.6

2010-06-01 Thread Hassan Schroeder
On Tue, Jun 1, 2010 at 1:19 PM, Gregor wrote: > after spending some hours on installing ruby on rails, I passed the > point to start my server. "hours"? That doesn't sound promising :-) > But mongrel failed to start with the following message: > /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib

[Rails] Re: ice_cube 0.3.1

2010-06-01 Thread mikrogroove
That is awesome news John, I am sure this will become a hugely popular gem - it's almost a complete calendaring system in a box! I wish my skills were up to a level where I could offer to help, but I fear I'd just mess things up for you :s Please know that your efforts are greatly appreciated! mik

[Rails] Starting Mongrel failes on Mac OS 10.6

2010-06-01 Thread Gregor
Hi at all, after spending some hours on installing ruby on rails, I passed the point to start my server. But mongrel failed to start with the following message: => Booting Mongrel => Rails 2.3.8 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server Exi

[Rails] Ruby on Rails + Flash Application ?

2010-06-01 Thread TINODEV
Hello, I'm a Ruby on Rails beginner, as well as Flash beginner.. Recently started developing a Web application using Ruby on Rails (I'm using InstantRails on Windows..).. Few days ago the Application's design was changed and now the requirement is a Flash-based Web Application. Now, this brings m

[Rails] Re: Authorize AASM state transitions with Declaraive_Authorization ?

2010-06-01 Thread TINODEV
Hey, First of all - @Brian - I apologise for double sending this to you.. since can only reply to author, now Cc-ing the group email as well.. Ok, question as follows: I'm using Restful_Authentication plugin (generated authenticated user sessions with --include-activation and --aasm) and the Decl

[Rails] Re: ice_cube 0.3.1

2010-06-01 Thread John Crepezzi
Yep, since ice_cube is made for occurrences and not durations - you'd have to store these separately. I'm working with a branch now that will support end_times for rules, so you could call occurring_at? (Time.now) on a rule and see if it occurs anywhere in the duration. I'll have this ready in th

[Rails] Re: Re: Only display 5 items at a time with more button

2010-06-01 Thread Matt Royer
Michael Pavling wrote: > First off; rather than reversing the @orders; why don't you have the > finder that populates it order how you want? Seems like an extra, > redundant step to me. Thank you very much for the tip! I'm still getting the hang of Rails and Ruby. It was a way that worked quickly

Re: [Rails] Re: Only display 5 items at a time with more button

2010-06-01 Thread Michael Pavling
On 1 June 2010 21:32, Matt Royer wrote: > Matt Royer wrote: >> <% @orders.reverse.each do |order| %> First off; rather than reversing the @orders; why don't you have the finder that populates it order how you want? Seems like an extra, redundant step to me. > Nevermind. I know I should post this

[Rails] Re: Authorize AASM state transitions with Declaraive_Authorization ?

2010-06-01 Thread Brian V. Hughes
Unfortunately, as you can tell from my original message, I'm a state_machine user, not an aasm user. Nor have I ever used Restful_Authentication in my of my Rails apps. So, I'm not sure I can be of any help with your problem. While aasm and state_machine both allow you to add finite state

[Rails] Re: Only display 5 items at a time with more button

2010-06-01 Thread Matt Royer
Matt Royer wrote: > > > > > > > <% @orders.reverse.each do |order| %> > > <%= link_to_remote( "#{order.id} #{order.name}" , :url => > {:controller => 'orders', :action => 'show', :id => order.id }, :update > => "order_div", :method => 'get' ) %> > > <% end %> > > > > > > > >

[Rails] Re: Re: creating text_field by clicking button

2010-06-01 Thread Lamer Lamer
Hassan Schroeder wrote: > On Tue, Jun 1, 2010 at 12:19 PM, Lamer Lamer > wrote: > >> do you know where can I find some sample codes or documents? > > Seriously, WTF?? > > Use "javascript tutorial" as a Google search phrase and you'll have > enough examples and documents to last you through sum

[Rails] Only display 5 items at a time with more button

2010-06-01 Thread Matt Royer
I have the following code: <% @orders.reverse.each do |order| %> <%= link_to_remote( "#{order.id} #{order.name}" , :url => {:controller => 'orders', :action => 'show', :id => order.id }, :update => "order_div", :method => 'get' ) %> <% end %> I want to create a button or lin

[Rails] Re: Re: Re: Re: Model.find statements: SQL condition format

2010-06-01 Thread Marnen Laibow-Koser
Michael Pavling wrote: [...] > PS In re-reading my earlier posts I sound a little stroppy/terse... > maybe I'm just in a "Marnen" mood today... apologies if it wasn't > apparent that I'm actually keen for you to understand and solve your > problem. Sheesh, I know it's bad when my name comes up lik

Re: [Rails] Re: creating text_field by clicking button

2010-06-01 Thread Hassan Schroeder
On Tue, Jun 1, 2010 at 12:19 PM, Lamer Lamer wrote: > do you know where can I find some sample codes or documents? Seriously, WTF?? Use "javascript tutorial" as a Google search phrase and you'll have enough examples and documents to last you through summer, at a minimum. Plus, you'll be able t

[Rails] Re: creating text_field by clicking button

2010-06-01 Thread Lamer Lamer
Colin Law wrote: > On 1 June 2010 19:50, Lamer Lamer wrote: >> and add more than one line >> -- > > I think you will have to use javascript or AJAX > > Colin do you know where can I find some sample codes or documents? -- Posted via http://www.ruby-forum.com/. -- You received this message be

[Rails] Re: ice_cube 0.3.1

2010-06-01 Thread mikrogroove
Hi John, Many thanks for your quick reply! I knew about the .until() option, but it's not quite what I was after though. From the readme: "Individual rules may optionally specify an until date, which is a date that that individual rule is no longer effective". I need the rule to remain effective

Re: [Rails] creating text_field by clicking button

2010-06-01 Thread Colin Law
On 1 June 2010 19:50, Lamer Lamer wrote: > Hi everyone, > > I like to learn how to create text_field by cliking button as dynamicly. > I need "add" button which creates 3 text_fields on the same line, > "height" * "width" = "size" > > I like to click button and creating 3 text fileds one takes hei

Re: [Rails] creating text_field by clicking button

2010-06-01 Thread Hassan Schroeder
On Tue, Jun 1, 2010 at 11:50 AM, Lamer Lamer wrote: > I like to learn how to create text_field by cliking button as dynamicly. > I need "add" button which creates 3 text_fields on the same line, > "height" * "width" = "size" This has nothing to do with Rails. Find a book or tutorial on JavaScri

[Rails] creating text_field by clicking button

2010-06-01 Thread Lamer Lamer
Hi everyone, I like to learn how to create text_field by cliking button as dynamicly. I need "add" button which creates 3 text_fields on the same line, "height" * "width" = "size" I like to click button and creating 3 text fileds one takes height, one takes width and third one calculate area with

[Rails] Re: ActiveRecord model relationship with YAML file

2010-06-01 Thread Cyril Wack
Colin Law wrote: > On 31 May 2010 22:43, Paul A. wrote: >> I would be happy if I can do this (as example): User.first.group.id # => >> 2 > > You could run a rake task to put the data in the database, unless > there is a good reason why you need it in a yaml file. > I have 3 goods reasons for th

[Rails] Re: Re: Re: Re: Model.find statements: SQL condition format -> How?

2010-06-01 Thread Tom Ha
> PS In re-reading my earlier posts I sound a little stroppy/terse... > maybe I'm just in a "Marnen" mood today... apologies if it wasn't > apparent that I'm actually keen for you to understand and solve your > problem. Yeah, I want my money back! ;-) -- Posted via http://www.ruby-forum.com/. --

[Rails] modifiying existing files in your template script

2010-06-01 Thread robo
Ok, so I just started digging into template files using the command rails mynewprojectname -m templatescript.rb and it's really, really awesome 8) What I want to do is something like this in my script - generate(:scaffold, "user name:string") rake("db:migrate") # add some code into the scaffold

Re: [Rails] Re: Re: Re: Model.find statements: SQL condition format -> How?

2010-06-01 Thread Michael Pavling
On 1 June 2010 15:51, Tom Ha wrote: > It's just that based on the API, I couldn't figure out if/where/how to > place the "count" part in the find statement... The problem is a little circular - as the count is nothing to do with Rails, it's a function of the DB, and you need to know how the SQL w

[Rails] Re: Is there a way to obtain the body of the last render?

2010-06-01 Thread mrbana...@googlemail.com
What about response_body? -- Volker dave4...@greatchiro.com schrieb: > Is there a way to obtain the response body of the last render in > Rails3 beta3? > > For example, given: > render :action=>'aaa', :layout=>'bbb' > > I had thought something like @_current_render would work but it did > not

[Rails] Re: Element.insert_html is not function

2010-06-01 Thread mrbana...@googlemail.com
Hi, Please verify that all included javascript files get successfully loaded into your html page. -- Volker Santosh Dvn schrieb: > Hi > > I have created the application by following the railcast video > > http://railscasts.com/episodes/74-complex-forms-part-2 > > However I am getting this error

[Rails] Re: Specify filename using rails Metal

2010-06-01 Thread Frederick Cheung
On Jun 1, 5:17 pm, guillaume wrote: > Hi, > > I'm using Rails Metal to serve certain files, > But i don't know how to change the filename ... > > Here is the code in Metal where i send the file : > [200, { 'Content-Type' => file.content_type}, [file.read]] > > I tried to specify 'filename'=>'tes

[Rails] Specify filename using rails Metal

2010-06-01 Thread guillaume
Hi, I'm using Rails Metal to serve certain files, But i don't know how to change the filename ... Here is the code in Metal where i send the file : [200, { 'Content-Type' => file.content_type}, [file.read]] I tried to specify 'filename'=>'test.zip'... but without success... Anyone has a clue ?

[Rails] Re: Re: Leading Zeros in a Method

2010-06-01 Thread Robert Walker
Matt Royer wrote: > Colin Law wrote: >> No, that an instance method of Order so will only work on Order >> objects. It will work in any view (associated with any controller) >> but only if you have an Order object. > > Oh, okay. Little by little (very little it seems so far) I'm getting the > ha

Re: [Rails] Re: Leading Zeros in a Method

2010-06-01 Thread Colin Law
On 1 June 2010 16:18, Matt Royer wrote: > Peter Hickman wrote: >> you could create a method called >> >> def leading_zeros(number) >>   "%05d" % number >> end >> >> and then call it >> >> "#{leading_zeros order.id}#{order.name}" >> > > Thanks Peter! > > I put the method in the application_helper.r

[Rails] Re: Re: Leading Zeros in a Method

2010-06-01 Thread Matt Royer
Colin Law wrote: > No, that an instance method of Order so will only work on Order > objects. It will work in any view (associated with any controller) > but only if you have an Order object. Oh, okay. Little by little (very little it seems so far) I'm getting the hang of this. Man, this stuff i

Re: [Rails] Welcome Board!!!(0.0.0.0:3000)

2010-06-01 Thread Carina Brito
They problem is sqlite3... the gem need install look at this blog :http://raphaeldealmeida.wordpress.com/ .. 2010/6/1 Hassan Schroeder > On Tue, Jun 1, 2010 at 7:43 AM, Raghu Maddali > wrote: > > > > /!\ FAILSAFE /!\ Tue Jun 01 20:11:00 +0530 2010 > > Status: 500 Internal Server Error > > n

[Rails] Re: Re: Leading Zeros in a Method

2010-06-01 Thread Matt Royer
Colin Law wrote: > Are you sure line 9 of that file is the one you have shown above? > Have you remembered to save the file? I forgot to take my previous solution out of the view. :) Dumb mistake, I know. Thanks Colin for you help! --Matt Royer -- Posted via http://www.ruby-forum.com/. -- Yo

Re: [Rails] Re: Leading Zeros in a Method

2010-06-01 Thread Colin Law
On 1 June 2010 16:20, Matt Royer wrote: > Colin Law wrote: >> Rather than attempt to add a method to the String class, which is what >> you seem to be suggesting, You could add a method to your model that >> returns the id and name as a formatted string.  So in order.rb >> something like >> def or

[Rails] Re: Leading Zeros in a Method

2010-06-01 Thread Matt Royer
Matt Royer wrote: > Thanks Peter! > > I put the method in the application_helper.rb file: > > > def leading_zeros(number) > "%05d" % number > end > > > And then put the following like you said: > > > #{leading_zeros order.id} #{order.name}" > > > It's giving m

[Rails] Re: Leading Zeros in a Method

2010-06-01 Thread Matt Royer
Colin Law wrote: > Rather than attempt to add a method to the String class, which is what > you seem to be suggesting, You could add a method to your model that > returns the id and name as a formatted string. So in order.rb > something like > def order_code > "#{'%05d' % id} #{name}" > end > Th

[Rails] Re: Leading Zeros in a Method

2010-06-01 Thread Matt Royer
Peter Hickman wrote: > you could create a method called > > def leading_zeros(number) > "%05d" % number > end > > and then call it > > "#{leading_zeros order.id}#{order.name}" > Thanks Peter! I put the method in the application_helper.rb file: def leading_zeros(number) "%05d

[Rails] Re: Ruby on Rails installation issue

2010-06-01 Thread John T.
Eugene Wolfson wrote: > Hello everyone. I am new to Rails (and Ruby) and when I was going > through the example in chapter 4 of Agile Web Development on Rails, I > ran into a problem. > > I think the issue is where rails is looking for sqlite3. Any help would > be appreciated. > > Thank you! >

[Rails] Re: Ruby with Java

2010-06-01 Thread dancook
Thanks On Jun 1, 4:03 pm, Robert Walker wrote: > dancook wrote: > > Are you sure? > > > I'm asking about the limitations of Ruby on Rails (not JRuby on Rails) > > integrating with Java. > > > I found 'Ruby Java Bridge', so that Ruby can use Java libraries. > > > I have been asked to investigate t

Re: [Rails] Leading Zeros in a Method

2010-06-01 Thread Peter Hickman
you could create a method called def leading_zeros(number) "%05d" % number end and then call it "#{leading_zeros order.id}#{order.name}" What you have with ""#{order.id}".leading_zeros is that #{order.id} will evaluate to a string and then you are trying to call the leading_zeros method on t

Re: [Rails] Leading Zeros in a Method

2010-06-01 Thread Colin Law
On 1 June 2010 15:44, Matt Royer wrote: > I found the following topic in the forum: > http://www.ruby-forum.com/topic/82137 > > Ian J Cottee had an easy way of adding leading zeros to a number: > > > > "%05d" % an_int > > > > I'm still new to ruby, so I wanted to know. How would I put th

[Rails] Re: Ruby with Java

2010-06-01 Thread Robert Walker
dancook wrote: > Are you sure? > > I'm asking about the limitations of Ruby on Rails (not JRuby on Rails) > integrating with Java. > > I found 'Ruby Java Bridge', so that Ruby can use Java libraries. > > I have been asked to investigate the possibility of using RoR, on top > of an existing java

[Rails] Re: Re: Re: Model.find statements: SQL condition format -> How?

2010-06-01 Thread Tom Ha
> What wasn't? Without quoting a previous message, no one knows what > you're replying to. I was replying to the last message: "there should be an extra ')'" > Again, I'll ask you; what bit of the API did you find confusing? It's just that based on the API, I couldn't figure out if/where/how to

Re: [Rails] Re: Re: Restarting apache web server

2010-06-01 Thread Colin Law
On 1 June 2010 15:38, Raghu Maddali wrote: > Hi > I'm sorry for miscommunication. > I've installed rails using the guide I've mentioned in the first > post...I guess the default configured web server will be webrick...But > I've configured my rails app to use Apache as a webserver...Now,how do > m

Re: [Rails] Welcome Board!!!(0.0.0.0:3000)

2010-06-01 Thread Hassan Schroeder
On Tue, Jun 1, 2010 at 7:43 AM, Raghu Maddali wrote: > > /!\ FAILSAFE /!\  Tue Jun 01 20:11:00 +0530 2010 >  Status: 500 Internal Server Error >  no such file to load -- sqlite3 Make sure you have both sqlite3 and the sqlite3 gem installed. FWIW, googling "no such file to load -- sqlite3" would

[Rails] Leading Zeros in a Method

2010-06-01 Thread Matt Royer
I found the following topic in the forum: http://www.ruby-forum.com/topic/82137 Ian J Cottee had an easy way of adding leading zeros to a number: "%05d" % an_int I'm still new to ruby, so I wanted to know. How would I put this into a method that I can attach to whatever string I want

[Rails] Welcome Board!!!(0.0.0.0:3000)

2010-06-01 Thread Raghu Maddali
I got stuck up with this problem. When I run the command ruby script/server,it gets me something like this... # ruby script/server => Booting Mongrel => Rails 2.3.8 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server However,when I open my browser

[Rails] Re: Re: Restarting apache web server

2010-06-01 Thread Raghu Maddali
Hi I'm sorry for miscommunication. I've installed rails using the guide I've mentioned in the first post...I guess the default configured web server will be webrick...But I've configured my rails app to use Apache as a webserver...Now,how do make a test to make sure that my rails application is

[Rails] submitting form in utf_8

2010-06-01 Thread Mlle
How can I ensure that my form submits with characters in utf-8? The params hash is showing as below though the part "d'\xC3\xA9nergie" should say "d'énergie" The text in the input field is set by means of javascript from clicking an element in a list in a popup. "treatments_attributes"=> {"0"=>

Re: [Rails] Re: Re: Model.find statements: SQL condition format -> How?

2010-06-01 Thread Michael Pavling
On 1 June 2010 15:18, Tom Ha wrote: > Well, just like the answer to my question, this wasn't obvious from the > API. What wasn't? Without quoting a previous message, no one knows what you're replying to. Again, I'll ask you; what bit of the API did you find confusing? There's several references

[Rails] Re: Re: Model.find statements: SQL condition format -> How?

2010-06-01 Thread Tom Ha
Well, just like the answer to my question, this wasn't obvious from the API. -- 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.co

[Rails] Re: Generating Dynamic text box

2010-06-01 Thread Max Williams
What's your question? Can you express it simply without listing your entire codebase? -- 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...@googl

Re: [Rails] Re: Restarting apache web server

2010-06-01 Thread Colin Law
On 1 June 2010 15:00, Raghu Maddali wrote: > How do I make sure(test,if any) that my rails application is configured > with apache2 webserver I have installed?? > Sorry, don't understand. What are you trying to be sure of? Colin -- You received this message because you are subscribed to the G

[Rails] Re: ice_cube 0.3.1

2010-06-01 Thread John Crepezzi
Mikro, Thanks, I'm glad you like it :) Individual rules can take an end date as follows: rule = IceCube::Rule.weekly.until(Time.local(2010, 10, 6)) Just a note: Until times are inclusive. Hope this helps! Thanks, John Crepezzi On Jun 1, 5:43 am, mikrogroove wrote: > This is a great gem, and

[Rails] Re: Ruby with Java

2010-06-01 Thread dancook
Are you sure? I'm asking about the limitations of Ruby on Rails (not JRuby on Rails) integrating with Java. I found 'Ruby Java Bridge', so that Ruby can use Java libraries. I have been asked to investigate the possibility of using RoR, on top of an existing java infrastructure. (but specifically

Re: [Rails] Re: Model.find statements: SQL condition format -> How?

2010-06-01 Thread Colin Law
On 1 June 2010 14:42, Michael Pavling wrote: > On 1 June 2010 14:37, Colin Law wrote: >> if one understands >> ActiveRecord syntax fully and one codes up a find, then one *can* be >> sure that it is correct. > > I concede that's very true. > > (but it's the "understanding" that's the problem :-)

[Rails] Spawning sleeper threads... good idea? bad?

2010-06-01 Thread Danimal
Hello! I am building an application that requires users to complete a short tutorial after registration in order to fully activate their account. When a user registers, they get an email saying something like "thanks for registering. Please complete the tutorial by clicking _here_" which links to

Re: [Rails] Re: Showing 404 page from controller in Rails 3

2010-06-01 Thread Jeffrey L. Taylor
Raising. In Rails 1.x and 2.x, ActiveRecord:NotFound exception is caught by Rails and it displays the 404 page. HTH, Jeffrey Quoting Mirko : > Do you mean rescuing or raising ActiveRecord::NotFound? > > On Jun 1, 4:54 am, "Jeffrey L. Taylor" wrote: > > Quoting Joshua Partogi : > > > > > Hi a

[Rails] Re: Restarting apache web server

2010-06-01 Thread Raghu Maddali
How do I make sure(test,if any) that my rails application is configured with apache2 webserver I have installed?? -- 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 ema

Re: [Rails] Combining Two Models into one form

2010-06-01 Thread Gael Muller
On Tue, Jun 1, 2010 at 4:49 AM, Matias Niemela wrote: > Hey Guys. > > I'm very new with rails and I've been building a CMS application > backend. > > All is going well, but I would like to know if this is possible? > > Basically I have two models: > > @page { id, name, number } > > @extended_page

[Rails] Re: Ruby with Java

2010-06-01 Thread Robert Walker
dancook wrote: > I've been tasked to investigate using Ruby on Rails with Java > integration, use of java libraries and being deployed on tomcat/jboss/ > oc4j > > JRuby might seem like the obvious choice, but I still need to know the > limitations of Ruby integrations with Java. > > Any informati

[Rails] reloading page with errors

2010-06-01 Thread Mlle
I use javascript to insert a nested model form into a page. If I use validation on the data entered and it reloads the page with an error displayed, the nested model form is gone because it's not part of the original template. Is there any way I can change it? -- You received this message becau

[Rails] Re: Showing 404 page from controller in Rails 3

2010-06-01 Thread Joshua Partogi
Hi Jeff and Mirko, Thank you very much for the response. By default active_record will raise ActiveRecord::NotFound exception when a record can not be found in the database. And when this occurs, it will display the 404 page from the public folder. Unfortunately this hasn't been working for me in

[Rails] Re: Re: Model.find statements: SQL condition format -> How?

2010-06-01 Thread Tom Ha
Yep, I would have liked to be able to use Rails without needing to dig deeper into SQL - at least as long as I'm not a professional coder... Anyways, from what I understand, the answer to my question is: With Rails, I need to use the :select parameter to have the "count part" (as described abov

[Rails] Re: Restarting apache web server

2010-06-01 Thread Raghu Maddali
> Only guessing, but have you tried removing the comment from your > RailsEnv line? Perhaps it is not interpreting it as a comment and so > complaining about the number of parameters. > > Colin Thnxx colin..it worked -- Posted via http://www.ruby-forum.com/. -- You received this message beca

[Rails] validation on nested models

2010-06-01 Thread Mlle
I use javascript to insert a nested model form into a page. If I use validation on the data entered and it reloads the page with an error displayed, the nested model form is gone because it's not part of the original template. Is there any way I can change it? -- You received this message becau

Re: [Rails] Re: Model.find statements: SQL condition format -> How?

2010-06-01 Thread Michael Pavling
On 1 June 2010 14:37, Colin Law wrote: > if one understands > ActiveRecord syntax fully and one codes up a find, then one *can* be > sure that it is correct. I concede that's very true. (but it's the "understanding" that's the problem :-) -- You received this message because you are subscribed

Re: [Rails] Restarting apache web server

2010-06-01 Thread Colin Law
On 1 June 2010 14:26, Raghu Maddali wrote: > Hi, > > I'm following this guide https://help.ubuntu.com/community/RubyOnRails > to install ror and configure this with apache..I'm facing a problem when > restarting the apache2 web server following some steps. > ___

[Rails] Ruby on Rails installation issue

2010-06-01 Thread Eugene Wolfson
Hello everyone. I am new to Rails (and Ruby) and when I was going through the example in chapter 4 of Agile Web Development on Rails, I ran into a problem. I think the issue is where rails is looking for sqlite3. Any help would be appreciated. Thank you! Here is the versions and locations of sql

Re: [Rails] Re: Model.find statements: SQL condition format -> How?

2010-06-01 Thread Colin Law
On 1 June 2010 14:21, Michael Pavling wrote: > On 1 June 2010 14:03, Colin Law wrote: >> Michael >> To some extent I agree with Tom here, ideally it should be possible to >> get straight to the answer without going through the sql.  The >> condition is that the number of authors for the book shou

[Rails] Restarting apache web server

2010-06-01 Thread Raghu Maddali
Hi, I'm following this guide https://help.ubuntu.com/community/RubyOnRails to install ror and configure this with apache..I'm facing a problem when restarting the apache2 web server following some steps. _ Now you should p

Re: [Rails] Re: Model.find statements: SQL condition format -> How?

2010-06-01 Thread Michael Pavling
On 1 June 2010 14:03, Colin Law wrote: > Michael > To some extent I agree with Tom here, ideally it should be possible to > get straight to the answer without going through the sql.  The > condition is that the number of authors for the book should be greater > than 5 and > that published should b

Re: [Rails] Re: Re: Model.find statements: SQL condition format -> How?

2010-06-01 Thread Michael Pavling
On 1 June 2010 13:57, Tom Ha wrote: > ...and that I'd like to avoid the find_by_sql method (raw SQL), if > possible. Yes - do not use "find_by_sql" for this... But you *DO* need to know what the SQL is to generate the results you want. > I cannot figure out what parameter(s) (like :limit, :grou

[Rails] Element.insert_html is not function

2010-06-01 Thread Santosh Dvn
Hi I have created the application by following the railcast video http://railscasts.com/episodes/74-complex-forms-part-2 However I am getting this error when I click "add element" RJS error: TypeError: Element.insert is not a function and then Element.insert("docs", { bottom: "\n\n Doc:

Re: [Rails] Re: Model.find statements: SQL condition format -> How?

2010-06-01 Thread Colin Law
On 1 June 2010 13:45, Michael Pavling wrote: > On 1 June 2010 13:03, Tom Ha wrote: >> Thanks - and no worries re the model, it's just an example... > > If the code you post is an example, then SQL I posted won't work. As I > said, I'd suggest you get the SQL working for your specific situation, >

[Rails] Ruby with Java

2010-06-01 Thread dancook
I've been tasked to investigate using Ruby on Rails with Java integration, use of java libraries and being deployed on tomcat/jboss/ oc4j JRuby might seem like the obvious choice, but I still need to know the limitations of Ruby integrations with Java. Any information would be appreciated, google

[Rails] Re: Re: Model.find statements: SQL condition format -> How?

2010-06-01 Thread Tom Ha
Thanks for getting back! Well, to put it bluntly: I cannot figure out what parameter(s) (like :limit, :group, etc.) of the find method I have to use to create the count "condition" in the find statement. By "count condition" I mean the part: number-of-authors-must-be-greater-than-5 Assume

[Rails] validation on nested models

2010-06-01 Thread Mlle
this validation in my model only works for the first nested model. Why is that? def treatment_must_have_preptype errors.add(:preptype, I18n.translate('activerecord.errors.messages.nestedTrempty')) if treatment_preptype_empty? end def treatment_preptype_empty? if !treatments.empty?

Re: [Rails] Re: Model.find statements: SQL condition format -> How?

2010-06-01 Thread Michael Pavling
On 1 June 2010 13:03, Tom Ha wrote: > Thanks - and no worries re the model, it's just an example... If the code you post is an example, then SQL I posted won't work. As I said, I'd suggest you get the SQL working for your specific situation, and then try to get the Rails find to generate the righ

[Rails] Re: Model.find statements: SQL condition format -> How?

2010-06-01 Thread Tom Ha
Yep, it's really the "number of authors" part that I have not understood yet. If I try as you say (using authors.count > 5 in the "conditions") an error message tells me that there is no column called "count"... -- Posted via http://www.ruby-forum.com/. -- You received this message because yo

Re: [Rails] Model.find statements: SQL condition format -> How?

2010-06-01 Thread Colin Law
On 1 June 2010 12:15, Tom Ha wrote: > Hi there, > > What's the correct end part of "conditions" if: > > - you assume that "Book :has_many Authors" > - I'd like to have the find statement in the below format > > @books = Book.find(:all, >          :joins => [:authors => [...]], >    :include => :wh

[Rails] How to update counter_cache when updating a model?

2010-06-01 Thread vince
I have a very simple relationship - a container has many items containers(title, items_count) items(container_id, title) class Item < ActiveRecord::Base belongs_to :container, :counter_cache => true end My views/items/edit.html.erb looks like this: <%= f.label :assign_to_container %> <%=

[Rails] Re: Model.find statements: SQL condition format -> How?

2010-06-01 Thread Tom Ha
Thanks - and no worries re the model, it's just an example... Actually, I asked this question since I'd like to stick as much as possible to the "Rails way" of doing things (and therefor I'd like to try to avoid things like "original" SQL statements). So, any idea how the part... :condition

[Rails] Can not call RJS and throwing error

2010-06-01 Thread Venu Gopal
I created controllers of project and task and appropraite html pages for them and created two partials of fields and tasks and having link in fields partial, when i call it it is throwing RJS error, please find the code below and mention a solution for geting text box dynamically My Html page

Re: [Rails] Model.find statements: SQL condition format -> How?

2010-06-01 Thread Michael Pavling
On 1 June 2010 12:15, Tom Ha wrote: > Hi there, > > What's the correct end part of "conditions" if: > > - you assume that "Book :has_many Authors" > - I'd like to have the find statement in the below format > > @books = Book.find(:all, >          :joins => [:authors => [...]], >    :include => :wh

[Rails] Re: Chat app, Caching? Observe?

2010-06-01 Thread Tom Ha
Maybe you want to give this a try (there seems to be "no activity" currently, though...) http://code.google.com/p/canhaschat/ -- 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 gro

[Rails] Model.find statements: SQL condition format -> How?

2010-06-01 Thread Tom Ha
Hi there, What's the correct end part of "conditions" if: - you assume that "Book :has_many Authors" - I'd like to have the find statement in the below format @books = Book.find(:all, :joins => [:authors => [...]], :include => :whatever_stuff, :conditions => "books.publis

  1   2   >