[Rails] install plugin in rails 3

2010-10-14 Thread rajul
To install error_messages_for i run this commond but it does'nt work rails plugin install git://github.com/rails/dynamic_form.git please help me out i am using windows platform -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post

Re: [Rails] Re: How old are you?

2010-10-14 Thread Peter Hickman
5 track paper tape ... mumble mumble ... hollerith ... grumble grumble ... punch card ... mumble ... marveled at the technology that allowed us to encode *lowercase letters*!!!1!! (or 7 track paper tape as it was known). Actually I'm only 49 but I started quite young. I've been a paid programmer

[Rails] LoadError (no such file to load -- pg), OS X, Rails 3, Ruby 1.9.2, Postgres

2010-10-14 Thread Scott Ribe
Running OS X 10.6.4, wanted to work with the latest stuff, built Ruby 1.9.2 , installed rails 3.0.0 pg 0.9.0 using gem, the simplest example rails app gives me this whenever I try to access anything (except plain HTML in public): Started GET / for 127.0.0.1 at 2010-10-13 13:58:35 -0600

[Rails] ARes, Format, and Encoding

2010-10-14 Thread Micah Frost
After switching to ActiveModel serializers (http://github.com/rails/ rails/commit/7cd1d37a51f5f53f8fc1360f886d26cabf12d969), ARes no longer uses the format's encode, bypassing it in favor of ActiveModel serialization. I would like to shield myself from the particular JSON returned by the service

[Rails] Ruby on Rails Web Developer Gig for NGO Working in Haiti

2010-10-14 Thread JKurz2008
A medium size NGO is seeking a web developer with extensive experience in Ruby on Rails to help re-engineer and support an exciting project connected with the redevelopment of Haiti. The assignment will be US based and may not require any travel to Haiti, although willingness to go to Haiti for a

[Rails] problem running bundle install

2010-10-14 Thread sketchdude
I'm a new ruby on rails user and was just going through the tutorial at: http://guides.rubyonrails.org/getting_started.html All was going ok until I got to section 3.3 Installing the Required Gems at that point, the tutorial instructs you to run bundle install, which I did. Then I got this

[Rails] Re: problem running bundle install

2010-10-14 Thread prabesh shrestha
I don't know what is wrong with your installation .But ,no you don't have to be a member to run the command. On Oct 14, 4:54 am, sketchdude sketchd...@gmail.com wrote: I'm a new ruby n rails user and was just going through the tutorial at: http://guides.rubyonrails.org/getting_started.html

Re: [Rails] problem running bundle install

2010-10-14 Thread Maksim Gudovsikov
Hi, i think that bundler tries to install the gems globally for all users on your machine. It means into your system's gem repository. So you need to input the root password or your password if you're in the admin group to allow write access. If you want to install gems in your home dir have a

[Rails] How should one pass params to the comment form

2010-10-14 Thread Christian Fazzini
In my paintings controller, show action. I've got a comment form. How should I pass the painting_id and user_id to the form? Currently, my paintings controller looks like: def show @painting = Painting.find(params[:id]) @comment = Comment.new end -- You received this

[Rails] Re: problem running bundle install

2010-10-14 Thread Smit Shah
Hi, Maksim Gudovsikov is right. You can go through that option. Or simply first login as root user at your terminal and than try to run bundle install. Thanks -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on

[Rails] Re: How should one pass params to the comment form

2010-10-14 Thread Smit Shah
Hi, If you have fields like painting_id and user_id in your Comment table than you can do as follow. def show @painting = Painting.find(params[:id]) @comment = Comment.new @comment.user_id = @painting.user_id # Or your desire value... @comment.painting_id = @painting.id end

[Rails] Re: install plugin in rails 3

2010-10-14 Thread Smit Shah
what error you are having? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to

Re: [Rails] LoadError (no such file to load -- pg), OS X, Rails 3, Ruby 1.9.2, Postgres

2010-10-14 Thread Erol Fornoles
Do you have gem 'pg' on your Gemfile? On 10/14/10 4:09 AM, Scott Ribe wrote: Running OS X 10.6.4, wanted to work with the latest stuff, built Ruby 1.9.2 , installed rails 3.0.0 pg 0.9.0 using gem, the simplest example rails app gives me this whenever I try to access anything (except plain

[Rails] Re: How should one pass params to the comment form

2010-10-14 Thread Christian Fazzini
That doesnt work the form is submitted but the values user_id and painting_id are not set in the db. Only the comment is saved On Oct 14, 4:46 pm, Smit Shah li...@ruby-forum.com wrote: Hi, If you have fields like painting_id and user_id in your Comment table than you can do as follow.  

[Rails] Re: install plugin in rails 3

2010-10-14 Thread rajul
when i type this command rails plugin install git://github.com/rails/dynamic_form.git it show usage: Rails new APP_PATH [option] options: -r , [--ruby=path] # path to ruby binary of your choice . . . . . . . and something like this On Oct 14, 1:55 pm, Smit Shah li...@ruby-forum.com wrote:

[Rails] Re: How should one pass params to the comment form

2010-10-14 Thread Christian Fazzini
I think you mean: @comment = Comment.new @comment.user_id = @painting.user_id # Or your desire value... @comment.painting_id = @painting.id MUST be in the comment controller, create action. Not new or show action On Oct 14, 5:15 pm, Christian Fazzini christian.fazz...@gmail.com

Re: [Rails] Re: Re: Use of Editors(like Radrails,Netbeans) in ROR?

2010-10-14 Thread Mark Weston
Well, firstly let's be clear I'm not trying to sell RubyMine as my ideal IDE. I've paid for it, but I'm sometimes quite equivocal about whether it's much better than a terminal/editor combination. (Mind you, on the days I've needed to use the debugger I've been very glad to have it. But I'm

[Rails] undefined method?

2010-10-14 Thread aperture science
I'm trying to learn rails as I go along, and having a bit of trouble. There is an undefined method cropping that I don't know why rails thinks should be there. Firstly, I'm using rails 3, ruby 1.9.2 I have a controller with an index action This part works fine, but i am trying to add a comment

Re: [Rails] undefined method?

2010-10-14 Thread Erol Fornoles
You were using a singular resource when you should have defined a plural one. Also, you can specify the controller on your RESTful route instead of having to create a separate map.connect or match: resources :comments, :controller = 'controller1' I recommend that you use consistent naming with

[Rails] Re: Rails 3: Update responding with empty json

2010-10-14 Thread Aashish Kiran
I found the solution. use firebug to see response. Use image as attachment for help -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to

[Rails] Page rendering dies halfway but rails thinks it has finished

2010-10-14 Thread Max Williams
Hi all. I've got an odd problem which occurs on our server but doesn't happen locally. (On the server we have nginx with a mongrel cluster underneath) I have a request which takes a large amount of text from a text field, shoves it into a background process (done with spawn) to be processed,

[Rails] ActionMailer multipart messages with attachment rails3

2010-10-14 Thread Thomas Grebschrop
Hi, I try to send a multipart message with actionmailer under rails3. When the mail client receives the mail the attachment is empty. I do definitely attach a non-empty file. Here is the code: snip recipients [sec...@secret.com] from sec...@secret.com subject my subject

[Rails] no such file to load -- ZenTest but I have already installed ZenTest

2010-10-14 Thread Anders Nguyen
$ rake spec cucumber --trace (in /home/soroush/projects/mediapilot) ** Invoke spec (first_time) ** Invoke db:test:prepare (first_time) ** Invoke db:abort_if_pending_migrations (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:abort_if_pending_migrations **

[Rails] Re: Rails 2.3.8 - What happens to a datetime field between a form being submitted and the controller

2010-10-14 Thread voidstar
Hey, Thanks for the reply, I could easily write some code to discard the time field, which is what I'll probably do now but I'd just like to know how rails is doing this, I guess is should go about downloading the rails source and grok it myself. I'm in GMT but using daylight savings. I guess if

Re: [Rails] params function not working

2010-10-14 Thread radhames brito
@marnen He has a sorting function, i believe thats what he wanted to do, wouldnt it be easier for him to make an ajax call and return a partial? that is what i am suggesting. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this

[Rails] Re: Re: Re: Use of Editors(like Radrails,Netbeans) in ROR?

2010-10-14 Thread Marnen Laibow-Koser
Mark Weston wrote in post #950097: Well, firstly let's be clear I'm not trying to sell RubyMine as my ideal IDE. I've paid for it, but I'm sometimes quite equivocal about whether it's much better than a terminal/editor combination. Exactly. (Mind you, on the days I've needed to use the

Re: [Rails] Re: How should one pass params to the comment form

2010-10-14 Thread radhames brito
On Thu, Oct 14, 2010 at 5:43 AM, Christian Fazzini christian.fazz...@gmail.com wrote: I think you mean: @comment = Comment.new @comment.user_id = @painting.user_id # Or your desire value... @comment.painting_id = @painting.id MUST be in the comment controller, create action. Not

[Rails] Re: Rails 2.3.8 - What happens to a datetime field between a form being submitted and the controller

2010-10-14 Thread Marnen Laibow-Koser
voidstar wrote in post #950126: Hey, Thanks for the reply, I could easily write some code to discard the time field, which is what I'll probably do now You don't have to discard anything. Just ignore it. Check Rails' field types; I think if you define the field in the migration as date

[Rails] Nested form, perhaps?

2010-10-14 Thread Walter Lee Davis
I have a general design question, and haven't written any code for this feature yet. I'm setting up a control panel for a sort of team/ content management system. A new project needs a team to work on it. The project has been saved, so we don't have to worry about that. But each member of

[Rails] Re: undefined method?

2010-10-14 Thread aperture science
I'm still getting the undefined method `comments_index_path' error The extracted source points at: %= form_for(@comment) do |format| % I cannot find where that method would be being called from even...comments_index_path only appears in the development.log On Oct 14, 3:08 am, Erol Fornoles

[Rails] Re: params function not working

2010-10-14 Thread pepe
Anyway, any solution requiring js.erb is, almost by definition, doing it all wrong.  js.erb should never be necessary in a well-written project: you shouldn't be dynamically generating source code. What do you mean by dynamically generating source code here? Are you saying that going for a

[Rails] Re: params function not working

2010-10-14 Thread Marnen Laibow-Koser
pepe wrote in post #950138: Anyway, any solution requiring js.erb is, almost by definition, doing it all wrong. js.erb should never be necessary in a well-written project: you shouldn't be dynamically generating source code. What do you mean by dynamically generating source code here? Are you

Re: [Rails] Nested form, perhaps?

2010-10-14 Thread Bill Walton
Hi Walter, On Thu, Oct 14, 2010 at 7:46 AM, Walter Lee Davis wa...@wdstudio.com wrote: I have a general design question, and haven't written any code for this feature yet. I'm setting up a control panel for a sort of team/content management system. A new project needs a team to work on it. The

Re: [Rails] Nested form, perhaps?

2010-10-14 Thread Colin Law
On 14 October 2010 13:46, Walter Lee Davis wa...@wdstudio.com wrote: I have a general design question, and haven't written any code for this feature yet. I'm setting up a control panel for a sort of team/content management system. A new project needs a team to work on it. The project has been

Re: [Rails] Re: undefined method?

2010-10-14 Thread Erol Fornoles
Hmmm wait, I just noticed something. Could you rename your Comments model to Comment (from plural to singular). Don't forget to rename the model file (comments.rb to comment.rb) On 10/14/10 8:52 PM, aperture science wrote: I'm still getting the undefined method `comments_index_path' error The

Re: [Rails] Re: params function not working

2010-10-14 Thread radhames brito
No, absolutely not. I am saying that dynamically generating JS by means of ERb is a design problem. Receiving a partial from an Ajax call is fine. I would really like to see an example of how to pull a partial with ajax without js.erb or js.haml, in a easy way of course, note that if he

[Rails] Re: Re: params function not working

2010-10-14 Thread Marnen Laibow-Koser
Radhames Brito wrote in post #950151: No, absolutely not. I am saying that dynamically generating JS by means of ERb is a design problem. Receiving a partial from an Ajax call is fine. I would really like to see an example of how to pull a partial with ajax without js.erb or js.haml, in a

[Rails] Writing a Report on Ruby on Rails - Could anyone provide any insight

2010-10-14 Thread Josh Nathan
We have been ask about how Ruby on Rails could be intergrated into a 3- tier architecure for produce a single intergrated source of student data and information. It would included both adminstrative and public records etc. Any information on how Ruby on Rails could be used in this sense sucesfully

[Rails] Ice Cube Rails problem

2010-10-14 Thread James
I'm using Ice_Cube to try and get the rule from a Model to be used to create a schedule, like so: @temp_sched.add_recurrence_rule IceCube::Rule.from_yaml(Transaction.last.rule) However this doesn't seem to be the right thing, I just want to create a new Rule using the rule specified for each

[Rails] Re: Page rendering dies halfway but rails thinks it has finished

2010-10-14 Thread Frederick Cheung
On Oct 14, 12:45 pm, Max Williams li...@ruby-forum.com wrote: Looking in the log file, as far as rails is concerned it has completed the page render quite happily, and doesn't report any problems.  It's as if it has sent it back to the browser but the browser only gets some of it, not all.  

Re: [Rails] Writing a Report on Ruby on Rails - Could anyone provide any insight

2010-10-14 Thread Michael Pavling
On 14 October 2010 12:55, Josh Nathan tod.oder.e...@gmail.com wrote: We have been ask... Any information on how Ruby on Rails could be used in this sense sucesfully would be of great use, as well as information on how it could be intergrated with an Oracl Database. Rather than us doing your

[Rails] Apache httpd config for Passenger?

2010-10-14 Thread Hassan Schroeder
I need to build an Apache httpd to use with Passenger. Does anyone have recommended/suggested args to configure? TIA, -- Hassan Schroeder hassan.schroe...@gmail.com twitter: @hassan -- You received this message because you are subscribed to the Google Groups Ruby on

[Rails] Formatting Names and Addresses

2010-10-14 Thread tonypm
I have to import names and addresses that have already been created without any validation. Does anyone know if there exists a standard/utility/bit of code etc that does the formatting automatically. Using titleize is a start, but there are obviously lots of additional formatting requirements

Re: [Rails] Writing a Report on Ruby on Rails - Could anyone provide any insight

2010-10-14 Thread Bill Walton
Hi Josh, On Thu, Oct 14, 2010 at 6:55 AM, Josh Nathan tod.oder.e...@gmail.com wrote: We have been ask about how Ruby on Rails could be intergrated into a 3- tier architecure for produce a single intergrated source of student data and information. It would included both adminstrative and public

[Rails] Re: Rails 2.3.8 - What happens to a datetime field between a form being submitted and the controller

2010-10-14 Thread voidstar
I need a date/time object due to domain requirements although at this point I don't care about the time object, I just want it to be midnight. There are other ways for the user to enter data into this table where the time element becomes relevant. Where do I have the rails source? Also do you

[Rails] Re: Paperclip style not working with proc

2010-10-14 Thread Christian Fazzini
Anyone have a solution to this problem? On Oct 12, 12:36 pm, Christian Fazzini christian.fazz...@gmail.com wrote: My form submits the file. The custom processor I made for Paperclip uses FFMPEG. My custom processor expects a style to be set so that it can process the audio based on that value.

[Rails] Re: How should one pass params to the comment form

2010-10-14 Thread Christian Fazzini
Yeap, got it. Thanks for clearing that up Radhames On Oct 14, 8:32 pm, radhames brito rbri...@gmail.com wrote: On Thu, Oct 14, 2010 at 5:43 AM, Christian Fazzini christian.fazz...@gmail.com wrote: I think you mean:   �...@comment = Comment.new   �...@comment.user_id = @painting.user_id

Re: [Rails] Re: Rails 2.3.8 - What happens to a datetime field between a form being submitted and the controller

2010-10-14 Thread Michael Pavling
On 14 October 2010 15:52, voidstar barryodrisc...@gmail.com wrote: If anyone else is interested here's the code I'm using to reset the time to midnight. I'd suggest you use the Rails' .beginning_of_day method...

Re: [Rails] Re: Rails 2.3.8 - What happens to a datetime field between a form being submitted and the controller

2010-10-14 Thread Walter Lee Davis
On Oct 14, 2010, at 10:52 AM, voidstar wrote: Where do I have the rails source? Also do you know what file/class handles receiving a post request from a form? Open a new Terminal window and type gem server [and press return]. Open a new browser and visit http://0.0.0.0:8808 Each Gem you

[Rails] test:units error

2010-10-14 Thread Sangseok Lee
I am rails newbie and studying jruby on rails (rails3). I have written some simple sample program and test using rake test:units, but error occurred For MySQL, I use activerecord-jdbc-adapter (0.9.7) -- (in D:/work/study/rails/shoplet) **

Re: [Rails] using pg on snow leopard

2010-10-14 Thread Scott Ribe
See Erol Fornoles answer today to my same question yesterday... On Oct 13, 2010, at 2:59 PM, kenvogt wrote: I have a macbook running snow leopard. I recently installed postgresql 9.0 on it. I also installed pg with the following command: sudo env ARCHFLAGS='-arch x86_64' gem install pg

Re: [Rails] LoadError (no such file to load -- pg), OS X, Rails 3, Ruby 1.9.2, Postgres

2010-10-14 Thread Scott Ribe
On Oct 14, 2010, at 3:04 AM, Erol Fornoles wrote: Do you have gem 'pg' on your Gemfile? Ah, that was the problem. I was following a tutorial which did not mention this new aspect of Rails 3 configuration. Thanks much ;-) -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/

[Rails] Re: Re: Find account name

2010-10-14 Thread Leonel *.*
Another point, it might be worth providing a method somewhere called current_user (possibly in application_controller) that does the find, then you will not need to keep typing the find everywhere you want current_user. I'm trying to do exactly that, but the app doesn't seem to find the

[Rails] Re: Page rendering dies halfway but rails thinks it has finished

2010-10-14 Thread Robert Pankowecki (rupert)
You might be using some C extension that is crushing ? Anything in nginx or mongrel log files ? -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from

[Rails] Re: Ice Cube Rails problem

2010-10-14 Thread John Crepezzi
Hey, You can do: rule = Rule.weekly rule_yaml = rule.to_yaml schedule = Schedule.new(Time.now) schedule.add_recurrence_rule Rule.from_yaml(rule_yaml) Is this not what you're looking for? Maybe a little clarification will help Thanks, John Crepezzi On Oct 14, 8:26 am, James ja...@wooshy.com

Re: [Rails] Re: Rails 2.3.8 - What happens to a datetime field between a form being submitted and the controller

2010-10-14 Thread Colin Law
On 14 October 2010 15:52, voidstar barryodrisc...@gmail.com wrote: I need a date/time object due to domain requirements although at this point I don't care about the time object, I just want it to be midnight.  There are other ways for the user to enter data into this table where the time

[Rails] Re: Find account name

2010-10-14 Thread Leonel *.*
Found something very weird, the log trace reads... EPRECATION WARNING: Disabling sessions for a single controller has been deprecated. Sessions are now lazy loaded. So if you don't access them, consider them off. You can still modify the session cookie options with request.session_options.

Re: [Rails] Re: Re: Find account name

2010-10-14 Thread Colin Law
On 14 October 2010 16:32, Leonel *.* li...@ruby-forum.com wrote: Another point, it might be worth providing a method somewhere called current_user (possibly in application_controller) that does the find, then you will not need to keep typing the find everywhere you want current_user. I'm

[Rails] Re: Find account name

2010-10-14 Thread Leonel *.*
Ok, so I made this change: I used find_by_id instead of just find. APPLICATION CONTROLLER @company_id = User.find_by_id(session[:user_id]).account.id ERROR Routing Error undefined method `account' for nil:NilClass I'm not good at routing, but will read about it right now. If you got a

Re: [Rails] Formatting Names and Addresses

2010-10-14 Thread Philip Hallstrom
I have to import names and addresses that have already been created without any validation. Does anyone know if there exists a standard/utility/bit of code etc that does the formatting automatically. Using titleize is a start, but there are obviously lots of additional formatting

[Rails] Re: Re: Re: Find account name

2010-10-14 Thread Leonel *.*
Colin Law wrote in post #950191: On 14 October 2010 16:32, Leonel *.* li...@ruby-forum.com wrote: APPLICATION_CONTROLLER (error!) User.find(session[:user_id]).account.name ERROR Couldn't find User without an ID Can you show us the code around the error and how you are calling it? mmm...

Re: [Rails] Re: Find account name

2010-10-14 Thread Edmond Kachale
2010/10/14 Leonel *.* li...@ruby-forum.com Ok, so I made this change: I used find_by_id instead of just find. APPLICATION CONTROLLER @company_id = User.find_by_id(session[:user_id]).account.id ERROR Routing Error undefined method `account' for nil:NilClass I'm not good at routing, but

[Rails] Re: Formatting Names and Addresses

2010-10-14 Thread Marnen Laibow-Koser
tonypm wrote in post #950161: I have to import names and addresses that have already been created without any validation. Does anyone know if there exists a standard/utility/bit of code etc that does the formatting automatically. Using titleize is a start, but there are obviously lots of

[Rails] Re: Rails 2.3.8 - What happens to a datetime field between a form being submitted and the controller

2010-10-14 Thread Marnen Laibow-Koser
voidstar wrote in post #950166: I need a date/time object due to domain requirements although at this point I don't care about the time object, Huh? Design for what you have now, not what you might need in future. [...] Where do I have the rails source? Do you really need to ask? Remember,

[Rails] Re: Writing a Report on Ruby on Rails - Could anyone provide any insight

2010-10-14 Thread Josh Nathan
I and the rest of my group are students at the university collage london. We have had little or no experience in the world of information systems. It just happens to be an unfortunate part of our course that we have to complete this module. To Michael - before spouting off and being rather small

[Rails] Re: Re: Find account name

2010-10-14 Thread Leonel *.*
For testing sake (or whether you call it bug hunt), I would find the user first and search for the user's account. In that way I will be able to test for the avaliabilty of the user and the availability of the account separately. Thanks, ok, so I did this... APPLICATION CONTROLLER class

Re: [Rails] Re: Re: params function not working

2010-10-14 Thread radhames brito
So, something like (with jQuery): $.ajax({ url: http://myrailsapp.com/some_partial;, success: function (data) { $('#destination_element').innerHTML = data }) This is, I believe, the proper way to do it. would it be

[Rails] Validate that input doesn't contain default text?

2010-10-14 Thread Walter Lee Davis
I know I have written this before, but now I cannot find it. I want to make sure that my input doesn't contain 'Other...'. I know there's some lookbehind regex that can get that, but I have had nothing but errors when I try to use it in a validates_format_of block. Any suggestions?

[Rails] Building Custom jSon hashes

2010-10-14 Thread pipplo
Hi, I'm building a web service that will be accessed from a phone. So what I'm seeing so far is that building json responses seems to be quite limited (but I think I'm just missing something) Lets say I have users, and they can have different amounts of types of debt. In this case the debt is

Re: [Rails] Validate that input doesn't contain default text?

2010-10-14 Thread Walter Lee Davis
And I'm using Ruby 1.8.7, which does not include lookbehind regex, come to find. Walter On Oct 14, 2010, at 12:40 PM, Walter Lee Davis wrote: I know I have written this before, but now I cannot find it. I want to make sure that my input doesn't contain 'Other...'. I know there's some

Re: [Rails] Re: Writing a Report on Ruby on Rails - Could anyone provide any insight

2010-10-14 Thread Colin Law
On 14 October 2010 17:24, Josh Nathan tod.oder.e...@gmail.com wrote: I and the rest of my group are students at the university collage london. We have had little or no experience in the world of information systems. It just happens to be an unfortunate part of our course that we have to

Re: [Rails] Re: Re: Find account name

2010-10-14 Thread Colin Law
On 14 October 2010 17:27, Leonel *.* li...@ruby-forum.com wrote: For testing sake (or whether you call it bug hunt), I would find the user first and search for the user's account. In that way I will be able to test for the avaliabilty of the user and the availability of the account separately.

Re: [Rails] Re: Writing a Report on Ruby on Rails - Could anyone provide any insight

2010-10-14 Thread Philip Hallstrom
On Oct 14, 2010, at 9:48 AM, Colin Law wrote: On 14 October 2010 17:24, Josh Nathan tod.oder.e...@gmail.com wrote: I and the rest of my group are students at the university collage london. We have had little or no experience in the world of information systems. It just happens to be an

[Rails] Re: Building Custom jSon hashes

2010-10-14 Thread Marnen Laibow-Koser
pipplo wrote in post #950214: Hi, I'm building a web service that will be accessed from a phone. So what I'm seeing so far is that building json responses seems to be quite limited (but I think I'm just missing something) Lets say I have users, and they can have different amounts of types

[Rails] Re: Re: Re: params function not working

2010-10-14 Thread Marnen Laibow-Koser
Radhames Brito wrote in post #950213: So, something like (with jQuery): $.ajax({ url: http://myrailsapp.com/some_partial;, success: function (data) { $('#destination_element').innerHTML = data }) This is, I believe, the proper way to do it. would it be

[Rails] Re: is an application for state machine?

2010-10-14 Thread pepe
Sorry but my english understanding is very bad. Your English is fine for me, at least the written one. I've to make an application to monitor the installation and replacement of all the PCs in my company. [...] Do you think that one type of application of this kind is suitable for the use

[Rails] Re: Writing a Report on Ruby on Rails - Could anyone provide any insight

2010-10-14 Thread Josh Nathan
Hi Colin Okay, I do a business related course however it includes modules in IS, now I and the rest of my group with vouch on how appalling our lecturer is. This is the second lecture we have ever had, in which the first only contained a brief intro to 3-tier architecture. We now have this course

[Rails] Re: Writing a Report on Ruby on Rails - Could anyone provide any insight

2010-10-14 Thread Josh Nathan
PHILIP Thanks thats why I was really looking for, I'll research thay as come back with anymore questions in regards to those points, any further info would still be great. Best regards Josh -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group.

[Rails] Re: Re: Re: is an application for state machine?

2010-10-14 Thread Marnen Laibow-Koser
Msan Msan wrote in post #949863: On 13 October 2010 14:51, Marnen Laibow-Koser li...@ruby-forum.com wrote: Quite likely, but why do you even care at this stage? Determine how the What part didn't you understand? What I was trying to say was this: you're apparently in the early stages of

[Rails] Re: Validate that input doesn't contain default text?

2010-10-14 Thread Marnen Laibow-Koser
Walter Davis wrote in post #950212: I know I have written this before, but now I cannot find it. I want to make sure that my input doesn't contain 'Other...'. I know there's some lookbehind regex that can get that, but I have had nothing but errors when I try to use it in a validates_format_of

[Rails] Re: Building Custom jSon hashes

2010-10-14 Thread Frederick Cheung
On Oct 14, 5:46 pm, pipplo joe.kos...@gmail.com wrote: Is this possible?  How do I write json_for_X to return json etc? Is there a better way to do this? Are there templates that can be used for json like rendering partials? as long as json_for_X returns something that can be serialized to

[Rails] Bot-Away v1.2 Released

2010-10-14 Thread Colin Mackenzie iv
Bot-Away is a Ruby gem designed to prevent Web bots from spamming the forms on your Rails-based site without forcing you to resort to intrusive CAPTCHA fields. It employs a variety of techniques in an attempt to find a programmatic solution to the problem of automated spambots. Among other new

[Rails] Re: Building Custom jSon hashes

2010-10-14 Thread pipplo
Overwriting..I'm not even sure why I wrote that..I know better than that. I guess in general what I am getting at is that I might want the json to return mutliple objects for a reason or calculated values. I dont have a real example yet. I'm trying to define the interface between a phone app and

Re: [Rails] Re: Writing a Report on Ruby on Rails - Could anyone provide any insight

2010-10-14 Thread Michael Pavling
On 14 October 2010 17:24, Josh Nathan tod.oder.e...@gmail.com wrote: I and the rest of my group are students at the university collage london. Is that like a collection of newspaper cuttings about universities pasted onto a canvas? ;-) To Michael - before spouting off and being rather small

[Rails] Re: Rails 2.3.8 - What happens to a datetime field between a form being submitted and the controller

2010-10-14 Thread voidstar
Thanks for the replies, beginning_of_day makes a lot more sense. Yes Colin that's what's happening, I'd just like to know where exactly the string goes from dd/mm/ to being -mm-dd hh:mm:ss timezone offset and if there's anyway for me to control/over ride that behaviour. Marnen, You're

[Rails] has_many :through - creating a new model

2010-10-14 Thread José Mota
Hi guys! I'm having this trouble over relationships between models, like this: Venue (read a student's tests) --- Assignment --- Sheet (read musical sheets) Here's a video of what I need to accomplish: http://screenr.com/RQl It's pretty straightforward, I believe: when creating venues, I

Re: [Rails] Re: Re: Re: params function not working

2010-10-14 Thread radhames brito
I mean that you're apparently using it as a repeated pattern. I think it's an antipattern -- something that looks like a good design pattern at first, but is in fact to be avoided. I intentionally user $.get and $.post to a keep it simple, instead of using $.ajax, but the pattern i think is

Re: [Rails] Re: Rails 2.3.8 - What happens to a datetime field between a form being submitted and the controller

2010-10-14 Thread Colin Law
On 14 October 2010 19:38, voidstar barryodrisc...@gmail.com wrote: Thanks for the replies, beginning_of_day makes a lot more sense. Yes Colin that's what's happening, I'd just like to know where exactly the string goes from dd/mm/ to being -mm-dd hh:mm:ss timezone offset and if

[Rails] Re: using pg on snow leopard

2010-10-14 Thread kenvogt
On Oct 14, 8:31 am, Scott Ribe scott_r...@killerbytes.com wrote: See Erol Fornoles answer today to my same question yesterday... Ah, our messages must have crossed in the mail. My apologies for the duplicate message. For those searching for it, Scott's message is entitled: LoadError (no such

[Rails] Re: undefined method?

2010-10-14 Thread aperture science
Thanks, that gets the comment form loading. I added: def create @comment = Comment.new(params[:comments]) respond_to do |format| if @comment.save format.html { redirect_to('/', :notice = 'comment posted') } format.xml { render :xml = @comment, :status = :created,

[Rails] File links with wildcards(?)

2010-10-14 Thread Brandon P.
Hi All, I apologize for any incorrect/simplified verbiage I use; I'm a total Rails/Ruby novice. I also apologize if I've posted in the wrong category. I currently have a functioning Rails-based project management application up and running for my graphics company. The site simply manages all

[Rails] Cucumber Selenium web step to verify value of input field

2010-10-14 Thread David Kahn
I have an input field with an id which has a value. The web_steps.rb method does not find the value. Is this the right step to use to check an input field? It works fine for a text_area but not an input. Scenario steps (tried both ways): Then the travel_card_number_gate field should contain 5

[Rails] Re: Cucumber Selenium web step to verify value of input field

2010-10-14 Thread David Kahn
PS, this is the error message: Then the travel_card_number_gate field should contain 5 # features/step_definitions/web_steps.rb:150 expected: /5/, got: (using =~) Diff: @@ -1,2 +1 @@ -/5/

[Rails] Re: File links with wildcards(?)

2010-10-14 Thread Robert Walker
Brandon P. wrote in post #950271: So here is what I want to do: Create a simple link to the applicable PDF from the record editor/show. So if I'm viewing, for example, job/record 2010-1234 I'll have a rails-generated-link to it's respective PDF. The problem is that I need a link that looks

[Rails] Re: Re: Functional testing and HTTP authentication

2010-10-14 Thread Robert Walker
Peter Hultgren wrote in post #949955: Ah, so the question was unclear. Let me try to rephrase it: I want to write a test against my controller to make sure that the actions respond as they should, but since I have HTTP authentication turned on I get failures like this: response to be a

[Rails] Re: Re: Functional testing and HTTP authentication

2010-10-14 Thread Marnen Laibow-Koser
Robert Walker wrote in post #950276: Peter Hultgren wrote in post #949955: Ah, so the question was unclear. Let me try to rephrase it: I want to write a test against my controller to make sure that the actions respond as they should, but since I have HTTP authentication turned on I get

[Rails] Re: Re: Re: Find account name

2010-10-14 Thread Leonel *.*
Colin Law wrote in post #950219: On 14 October 2010 17:27, Leonel *.* li...@ruby-forum.com wrote: protect_from_forgery @user_id = User.find_by_id(session[:user_id]) @account_id = @user_id.account.id Doing it like that means that it will get executed when the controller loads, which in

[Rails] Cleaning up some security checking code

2010-10-14 Thread Creative Technologist
Hi, Does anyone have any thoughts on a cleaner way to achieve the following in a controller ... def show if current_user.can_access_organisation(params[:id]) @organisation = Organisation.find(params[:id]) end respond_to do |format| format.html # show.html.erb

[Rails] integration testing

2010-10-14 Thread Francois
i'm in the process of writing some integration tests on a rails 2.3.8 app and am running into a bit of difficulty: the following works just fine for me: get /login assert_response :success assert_template user_sessions/new post /user_session, :user_session = {:login = 'fr...@gmail.com',

[Rails] Re: Cleaning up some security checking code

2010-10-14 Thread pipplo
You only set @organisation to a value if the user can access the organization...so sometimes @organization is nil and you'll have an error when trying to access it. try something like this to make sure you don't try to access a nil value. if can access @organisation = respond_to do

  1   2   >