[Rails] Uploading files to Flickr with Rails

2008-12-31 Thread bdude
Hello, Api doc: http://www.flickr.com/services/api/upload.api.html I was wondering how I would go about taking files attached with a form, and then POSTing them to flickr and obtaining the response. Cheers, Bryce Roney --~--~-~--~~~---~--~~ You received this me

[Rails] Excessive Invalid Authenticity Token Errors

2008-12-31 Thread Mikel Lindsaar
Hello all. Got an Internal Rails 2.1.1 app. It is on an intranet and the computers accessing it do not access any other websites. I am getting a _lot_ of invalid authenticity errors. All the pages that are generating the errors are using the rails Form builder helpers with standard POST action

[Rails] Re: what is the id of the form_for

2008-12-31 Thread Greg Donald
On Wed, Dec 31, 2008 at 8:37 PM, Zhao Yi wrote: > I used form_for to generate a form, but what is the ID of this form, how > can I specify a ID for it. <% form_for :foo, @foo, :html => { :id => 'whatever" } do |f| -%> <% end -%> http://api.rubyonrails.com/classes/ActionView/Helpers/FormHelpe

[Rails] Re: validate not occurring transactionally

2008-12-31 Thread Robert Walker
Oh! And BTW this issue is by no means unique to Rails. I've had to deal with this issue in every ORM I've ever come across. Most ORMs don't even attempt to provide something "built-in" to help deal with this. In most of them you have to develop your own solution anyway. -- Posted via http://ww

[Rails] what is the id of the form_for

2008-12-31 Thread Zhao Yi
I used form_for to generate a form, but what is the ID of this form, how can I specify a ID for it. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" gro

[Rails] Re: validate not occurring transactionally

2008-12-31 Thread Robert Walker
unknown wrote: > #console 1 >> r = Review.new(:member_id => 1, :business_id => 4) This line does absolutely nothing at the database level. All you have done here is make a new Ruby object. >> r.sleep_for = 5 >> r.save! This row create a database transaction, writes the data from the Ruby object

[Rails] Model validation breaking integration test

2008-12-31 Thread bdeverea
Greetings, I have a simple model called "Section" with integration tests that pass. However, when I add a simple validation to the model (validates_presence_of :name) the integration test fails. This makes no sense to me because I am passing in a name. Does anyone know why that validation breaks

[Rails] Does observe_field work in a partial

2008-12-31 Thread Zhao Yi
I defined a partial and put an observe_field in this partial, but it doesn't invoke the action when the field changed, this is the code: <%=select_tag 'project_version', options_for_select(@project_versions)%> <%= observe_field :project_version, :update=>'view_name', :url=>{:action=>'up

[Rails] Re: How to render more than one partial?

2008-12-31 Thread Zhao Yi
Ramu wrote: > Your code will does this job. > > Is your problem some thing like: > you have a.rhtml file > int that you have to show _b.rhtml file contents as well as _c.rhtml > contents? > > Then write your code like this: > > == This is a.rhtml file > > <%= render :partial=>'b'%> > > <%

[Rails] Re: validate not occurring transactionally

2008-12-31 Thread parkert
On Dec 31, 2:58 pm, Frederick Cheung wrote: > Validations about uniqueness of things are prone to race conditions. > If you need a cast iron guarantee that can only come from the database > itself (ie unique index etc...) The app allows an "anonymous" user to have multiple reviews of a business,

[Rails] Re: Advice on Mac versus PC ?

2008-12-31 Thread wbsurf...@yahoo.com
One other thing that I am curious about is if I could put together text to speech utilities on a Mac using free stuff or what's already there ? I bought the book 'practical ruby projects' and from some stuff in there I did a simple utility that just runs from a dos shell. Anytime you highlight tex

[Rails] Re: Where is #put functional test method documented?

2008-12-31 Thread Patrick Doyle
> > users(:quentin) is instantiating the user based on your users.yml fixture. > Instead, you'll want to query the database for the user. > Yeah, that dawned on me as I wrote my email. But at that point I still wanted to find a better way to search the documentation. RailsBrain looks like a great

[Rails] Re: validate not occurring transactionally

2008-12-31 Thread Frederick Cheung
Validations about uniqueness of things are prone to race conditions. If you need a cast iron guarantee that can only come from the database itself (ie unique index etc...) Sent from my iPhone On 31 Dec 2008, at 21:04, park...@gmail.com wrote: > > I'm running into a strange problem with tran

[Rails] Re: Advice on Mac versus PC ?

2008-12-31 Thread wbsurf...@yahoo.com
Here's some other thoughts I had on macs after looking at this page and browsing around some sections on the bottom: http://developer.apple.com/macosx/architecture/index.html I think it might be cool sometime to maybe do some programming with ITunes if I could think of some cool projects. I nev

[Rails] validate not occurring transactionally

2008-12-31 Thread parkert
I'm running into a strange problem with transactions. I am seeing rare duplicate entries in the DB that should be prevented by my validations. Here is some sample code: class Review < ActiveRecord::Base has_one :member has_one :business attr_accessor :sleep_for def validate validat

[Rails] Understand submit_tag

2008-12-31 Thread Daniel Franca
Hi everyone, I was following the book Agile Web Development with Rails 2Ed. by Dave Thomas. So, at some part of my studies, I decided to try to create my own application based on what I've learned... Now I'm in trouble in a simple form. I tried to create a form to register new users. I'm sendin

[Rails] Re: Where is #put functional test method documented?

2008-12-31 Thread Craig Demyanovich
On Wed, Dec 31, 2008 at 3:26 PM, Patrick Doyle wrote: > I am trying to figure out why the following test case doesn't work: > > def test_should_allow_admin_to_become_non_admin > put :update, :id => users(:quentin).id, :quentin => {:admin => false} > assert users(:quentin).admin == false

[Rails] Where is #put functional test method documented?

2008-12-31 Thread Patrick Doyle
I am trying to figure out why the following test case doesn't work: def test_should_allow_admin_to_become_non_admin put :update, :id => users(:quentin).id, :quentin => {:admin => false} assert users(:quentin).admin == false assert_redirected_to users_url end For some reason, the "

[Rails] Why are JS requests using layouts?

2008-12-31 Thread Ben Johnson
If I specify a layout in a controller: class MyController < ApplicationController layout "some_layout" end Any JS request will use the some_layout. I thought certain requests types were exempt from layouts? When I remove the layout call everything works perfect, the problem is that it uses the a

[Rails] Re: Having Problems Starting with Ruby on the rails

2008-12-31 Thread Robby Russell
It's also not likely to work if you have a capital M... If you have a manage_controller... it'd just be /manage (sans-uppercase) On Wed, Dec 31, 2008 at 9:08 AM, bobnyso...@googlemail.com wrote: > > Please can you help I'm having this problem when I type in this URL on > my browser: http://loca

[Rails] Re: Ansuz CMS

2008-12-31 Thread knewter
Actually, I know exactly what it is :) http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1464 Bug in rails, patch on the ticket, I'll just let ansuz get it when rails fixes it. -Josh On Dec 31, 8:45 am, Martin wrote: > Hi, > > i tried to install it following your guide athttp:

[Rails] Re: Having Problems Starting with Ruby on the rails

2008-12-31 Thread AD
this wont work until you create a manage controller. On Wed, Dec 31, 2008 at 12:08 PM, bobnyso...@googlemail.com < bobnyso...@googlemail.com> wrote: > > Please can you help I'm having this problem when I type in this URL on > my browser: http://localhost:3000/Manage > > Routing Error > > No route

[Rails] Re: Having Problems Starting with Ruby on the rails

2008-12-31 Thread bobnyso...@googlemail.com
Please can you help I'm having this problem when I type in this URL on my browser: http://localhost:3000/Manage Routing Error No route matches "/Manage" with {:method=>:get} --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[Rails] [JOB] take over this Rails project!

2008-12-31 Thread Emanuele Tozzato
Hello Friends, I'm taking a sparkling RoR office job and I have to slow down and eventually give up the development of a good project I've been consulting for the last two months, it's for a 'sui generis' travel agency and it's Rails 2.1. Project is well paid, hours are totally flexible and tele

[Rails] Re: Ansuz CMS

2008-12-31 Thread knewter
Martin, I'd actually never ran rake gems before, so I hadn't seen that. I get the same thing on my machine, but rake gems:install successfully installed the ones I needed and it runs fine. I'll look into why that happens. If you ignore that, does it work for you? -Josh On Dec 31, 8:45 am, Ma

[Rails] How can I listen the events of module/class defined

2008-12-31 Thread wangyh.openg...@gmail.com
In our project, I need to listen the events of module/class defined, and record the events that include the context of the module/class defined. In ruby, I cannot add a listener for the module/class defined, only i can set a proc with set_trace_func, in the proc, I cannot get the module/class nam

[Rails] Re: link_to not asking confirmation (js)

2008-12-31 Thread pablo fernandez
Thanks so much, I was passing the args in the wrong order as you stated. On Tue, Dec 30, 2008 at 7:36 PM, Frederick Cheung wrote: > > > > On Dec 30, 8:59 pm, Pablo Fernandez > wrote: >> Hi, I have this link_to helper >> >> <%= link_to "edit", :action => 'edit', :id => @pirate, :confirm => >> 's

[Rails] change attribute names in serialized output - to_xml or to_json

2008-12-31 Thread jamie
When serializing an object, is there a way to change the name of an attribute outputted without changing the underlying model (i.e.. I do not want to change model attributes or methods? I have a class that has an association called materials... I would like the tag generated when I call to_xml to

[Rails] Re: How to render more than one partial?

2008-12-31 Thread Ramu
Your code will does this job. Is your problem some thing like: you have a.rhtml file int that you have to show _b.rhtml file contents as well as _c.rhtml contents? Then write your code like this: == This is a.rhtml file <%= render :partial=>'b'%> <%= render :partial=>'c' %> On Wed, Dec

[Rails] Re: YUI widgets, and JSON datasource generated by rails.

2008-12-31 Thread dzonekl
Hi, it's using JSON inside the library, but I doesn't seem to be able to query a server and get JSON back, which then populates the widgets. On Dec 30, 6:13 pm, Mark Thomas wrote: > > I wonder if someone has tried to populate a > > YUI Datasource > > with JSON generated by a rails controller? (S

[Rails] Re: query caching, Rails 2.2.2 and frozen attributes

2008-12-31 Thread Jeffrey L. Taylor
Quoting Rob Lacey : > > Hi there, > > I've recently upgraded our main application to Rails 2.2.2, but I've run > into an interesting problem. I am trying to update a User object for > example, but I keep getting the 'can't modify frozen hash' error when > attempting to call update attributes.

[Rails] Re: Ansuz CMS

2008-12-31 Thread Martin
Hi, i tried to install it following your guide at http://www.ansuzcms.com/ I had to create my databases manually using mysqladmin before I could install the required gems. I got them installed but when running > rake gems I get the following error: - [I] calendar_date_select - [ ] hoe >=

[Rails] jruby works as a deployment VM under windows(!)

2008-12-31 Thread Roger Pack
As a note, appears from the stories of Jruby [1] that you can actually use it as a nice stable rails deployment VM--on windows. That's right. It has acceptable speed on windows. Wowza. -=r [1] http://www.ruby-forum.com/topic/171481#new -- Posted via http://www.ruby-forum.com/. --~--~-

[Rails] refactoring a helper method

2008-12-31 Thread Taylor Strait
I am working on a site that does web surveys. I have created a helper method to create a likert scale table (e.g., 5 columns + row title, strongly dislike <-> strongly like). This method accepts an array of hashes and then uses the built in Rails helper form.radio_button to unwrap the hash and b

[Rails] replace_html problem

2008-12-31 Thread sa 125
Hi - trying to update a table with page.replace_html using a partial: The view (index.html.erb): [code=] <%= render :partial => 'product' %> [/code] The partial (_product.html.erb) [code=] <% for product in @products %> <%= product.name %> <%= product.vendor.name %> <% end %> [/code] Th

[Rails] Re: Rails migration framework in java

2008-12-31 Thread Maurício Linhares
There isn't anything like migrations for Java and Hibernate doesn't do it. Hibernate builds a whole schema based on your models and loads it into the database, but it's just that, you don't have versions, the "up" and "down" approach or anything like that. It would be like having only the schema.

[Rails] Rails migration framework in java

2008-12-31 Thread Ayyanar Aswathaman
Hi, Is there any schema framework in java similar to migration framework in rails. I heard that hibernate schema framework can do the same. But iam not able to compare both since i dont know hibernate. Any help? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~-

[Rails] query caching, Rails 2.2.2 and frozen attributes

2008-12-31 Thread Rob Lacey
Hi there, I've recently upgraded our main application to Rails 2.2.2, but I've run into an interesting problem. I am trying to update a User object for example, but I keep getting the 'can't modify frozen hash' error when attempting to call update attributes. It seems that the user object's a

[Rails] Re: How to get select_tag value in controller?

2008-12-31 Thread Vojtech Rinik
Oh I'm sorry that was probably wrong advice :) Forget about it. I just realized, that you're sending a http query, which looks like: name=value&name1=value1&... So it's pretty simple: query = "name="+...+"&name1="+... On 31.12.2008, at 12:50, Zhao Yi wrote: > > zero0x wrote: >> I suppose yo

[Rails] Re: automatically load subdirectories under app/models

2008-12-31 Thread Peter De Berdt
On 31 Dec 2008, at 06:08, Sijo Kg wrote: > I have found the the below code in environment.rb Here used > subdirectories to better organize files > > Dependencies.load_paths += [ > File.join(RAILS_ROOT, "app/models/Dir1"), File.join(RAILS_ROOT, > "app/models/Dir2") > ] > > What I understood is

[Rails] Re: How to get select_tag value in controller?

2008-12-31 Thread Vojtech Rinik
By sending JSON: {name: value, name1:value1, ... } in your case {name: $("id-of-the-element").getValue()} or something similiar. On 31.12.2008, at 12:50, Zhao Yi wrote: > > zero0x wrote: >> I suppose you're using prototype, so you just need to get the value >> of >> the select box. >> >> $(

[Rails] Re: How to get select_tag value in controller?

2008-12-31 Thread Zhao Yi
zero0x wrote: > I suppose you're using prototype, so you just need to get the value of > the select box. > > $("id-of-the-element").getValue() > > > > On 28. Dec., 15:04 h., Zhao Yi How can I send more than one parameters? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~-

[Rails] Re: How to render more than one partial?

2008-12-31 Thread Zhao Yi
Ryan Bigg wrote: > Render the other partial inside that partial. > - > Ryan Bigg > Freelancer > http://frozenplague.net Sorry, I am confused. This piece of code is my case: Version: <%= render :partial=>'project_version'%> View Name: <%= re

[Rails] Re: Problem with downloading Ziya plugin

2008-12-31 Thread Dharmdip Rathod
Dharmdip Rathod wrote: > Ryan Bigg wrote: >> You're going to have to download from github if nothing else works. No >> reason not to. Just download it and extract it into vendor/plugins >> - >> Ryan Bigg >> Freelancer >> http://frozenplague.net > I was afraid for version conflict. > Thanks. i

[Rails] Re: Problem with downloading Ziya plugin

2008-12-31 Thread Dharmdip Rathod
Ryan Bigg wrote: > You're going to have to download from github if nothing else works. No > reason not to. Just download it and extract it into vendor/plugins > - > Ryan Bigg > Freelancer > http://frozenplague.net I was afraid for version conflict. Thanks. -- Posted via http://www.ruby-forum.

[Rails] Help turn on ssl

2008-12-31 Thread Gilbert Gift Siima
Greetings to you all. I am trying to delop a site and wanted users to login seusurely over ssl. I am using rails 1.8.6 and when ever I try to configure the apache server using this code, it stopes giving me a spelling error or code not suitable Thisis the code I use to cinfigure the apche server

[Rails] Combining validation error messages

2008-12-31 Thread alyoshka
I used Ryan Bates' Railscasts episodes 73-75 to build forms with dynamic added models in complex forms. Everything works great, but displaying validation errors are a big mess since it displays it's own box for each individual error, including an error for each invalid child record in the parent b

[Rails] session store active_record_store doesn't work.

2008-12-31 Thread msd456
I want to use acitive record store session. So I edited files like below. *environment.rb config.action_controller.session_store = :active_record_store *application.rb protect_from_forgery :secret => '54420ada.' *rake task rake db:sessions:create #successfully created And controller a

[Rails] Re: count a occurence of given attribute

2008-12-31 Thread Ryan Bigg
Just do: agent.confirm_clients.count(["confirm = ?", true]) - Ryan Bigg Freelancer http://frozenplague.net On 31/12/2008, at 5:41 PM, Ishara Gunathilake wrote: > hi,, > i have a two tables named "agents" and "confirm_clients" > in confirm_clients columns > t.column :client_id, :string

[Rails] Re: Problem with downloading Ziya plugin

2008-12-31 Thread Ryan Bigg
You're going to have to download from github if nothing else works. No reason not to. Just download it and extract it into vendor/plugins - Ryan Bigg Freelancer http://frozenplague.net On 31/12/2008, at 4:35 PM, Dharmdip Rathod wrote: > > hello , > i am trying to download Ziya plugin

[Rails] Re: How to render more than one partial?

2008-12-31 Thread Ryan Bigg
Render the other partial inside that partial. - Ryan Bigg Freelancer http://frozenplague.net On 31/12/2008, at 4:54 PM, Zhao Yi wrote: > > I want to render more than one partial in this code: > > render :partial => 'project_version' > > how can I do this? > -- > Posted via http://www

[Rails] Re: A CSS issue

2008-12-31 Thread Jables
Thanks again to everyone for the top notch replies. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe fr

[Rails] Re: Presenters in Rails

2008-12-31 Thread Ryan Bigg
http://www.google.com/search?client=safari&rls=en-us&q=presenters+rails&ie=UTF-8&oe=UTF-8 - Ryan Bigg Freelancer http://frozenplague.net On 31/12/2008, at 4:28 PM, Sijo Kg wrote: > > Hi > Could anybody please explain what are presenters in Rails and how > they are used? > > Thanks in