[Rails] How to know which validation failed in the model validations.

2011-11-21 Thread Samir
Hi, I have a Users model that has a bunch of verifications such as email being unique and password being present etc.. In my controller I want to do @user.save and in case this failed due to the email not being unique (The user being created is already present in the db), I want to send an

[Rails] OmniAuth provider not working (single sign on, two Rails apps)

2011-11-21 Thread Rob Zolkos
I'm new to OmniAuth and am trying to get two sample apps (a provider and a client) to work. I have two sample apps I forked from a blog post on omniauth and single sign in: http://blog.joshsoftware.com/2010/12/16/multiple-applications-with-devise-omniauth-and-single-sign-on/ Provider -

[Rails] Build mobile apps for Rails sites — Would XML/JSON passing be the best approach?

2011-11-21 Thread Alec Taylor
Good evening, I am strongly considering building my project using Rails. My project will provide a web-interface and a mobile app. I was thinking to build the mobile app from XML sheets, i.e.: ?xml version=1.0 encoding=UTF-8? mobile version=3.1.3 newstorytext here/newstory newstorytext

[Rails] existing application with mysql migration

2011-11-21 Thread amvis
i have download one rails application. i am using mysql database. so i need to get the existing database into mysql, and run that application. how will run that application. i have search so many stuffs, but i didn't get related issues. how to migrate that schema into database. Thank you

Re: [Rails] scanning word document in ruby

2011-11-21 Thread Javier Quarite
Is there a way to read a doc/pdf that is uploaded to my rails app? using a gem or something? Javier -- 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

Re: [Rails] existing application with mysql migration

2011-11-21 Thread Colin Law
On 21 November 2011 11:30, amvis vgrkrish...@gmail.com wrote: i have download one rails application. i am using mysql database. so i need to get the existing database into mysql, and run that application. how  will run that application. i have search so many stuffs, but i didn't get related

Re: [Rails] scanning word document in ruby

2011-11-21 Thread Colin Law
On 21 November 2011 11:31, Javier Quarite jquari...@gmail.com wrote: Is there a way to read a doc/pdf that is uploaded to my rails app? using a gem or something? Is that not what this whole thread has been about? Colin -- You received this message because you are subscribed to the Google

Re: [Rails] Build mobile apps for Rails sites — Would XML/JSON passing be the best approach?

2011-11-21 Thread Peter De Berdt
On 21 Nov 2011, at 11:29, Alec Taylor wrote: I am strongly considering building my project using Rails. My project will provide a web-interface and a mobile app. I was thinking to build the mobile app from XML sheets, i.e.: ?xml version=1.0 encoding=UTF-8? mobile version=3.1.3 newstorytext

Re: [Rails] How to know which validation failed in the model validations.

2011-11-21 Thread Michael Pavling
On 21 November 2011 05:28, Samir samir.selma...@gmail.com wrote: In my controller I want to do @user.save and in case this failed due to the email not being unique (The user being created is already present in the db), I want to send an appropriate notice and redirect to a certain page. Save

Re: [Rails] scanning word document in ruby

2011-11-21 Thread Sathia S
On Mon, Nov 21, 2011 at 5:01 PM, Javier Quarite jquari...@gmail.com wrote: Is there a way to read a doc/pdf that is uploaded to my rails app? using a gem or something? Yes there is pdf toolkit for ruby. Please check this link http://mishmashmoo.com/blog/?p=4 Regards sathia

Re: [Rails] existing application with mysql migration

2011-11-21 Thread Sathia S
i have download one rails application. i am using mysql database. so i need to get the existing database into mysql, and run that application. how will run that application. i have search so many stuffs, but i didn't get related issues. how to migrate that schema into database. Change

Re: [Rails] Build mobile apps for Rails sites — Would XML/JSON passing be the best approach?

2011-11-21 Thread Alec Taylor
Sure, happy to use JSON as the format. I wouldn't want to use anything like PhoneGap, since I am also integrating hardware components. Not too mention I have C, C++, Ruby and Python skills to leverage, so native app development is no problem. In fact, I was considering open-sourcing this whole

[Rails] f.submit calls #destroy

2011-11-21 Thread manavortex
Hi group, i have a rather weird problem - if i use f.submit on my form, the controller calls #destroy. i can workaround that if i use button_to update, :controller = :mycontroller, :action = :update, but i don't really want that, and i want to get this issue fixed. anyone ever encountered this

Re: [Rails] f.submit calls #destroy

2011-11-21 Thread Everaldo Gomes
Hi. Could you post all the code of your form? On Mon, Nov 21, 2011 at 11:20 AM, manavortex ewa.baumgar...@emercs.comwrote: Hi group, i have a rather weird problem - if i use f.submit on my form, the controller calls #destroy. i can workaround that if i use button_to update, :controller =

[Rails] Re: Can't convert Symbol to string

2011-11-21 Thread Nat Noordanus
I came had this error and found it was being caused by trying to add a symbol to a string. ruby-1.9.2-p180 a string+:a_symbol #= TypeError: can't convert Symbol into String -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google

Re: [Rails] Build mobile apps for Rails sites — Would XML/JSON passing be the best approach?

2011-11-21 Thread Dhaval jain
Hi , I would suggest JSON instead of XML. JSON is very light weighted compared to xml and will help in faster proceesing of data on the mobile apps. Thanks, Dhaval On Mon, Nov 21, 2011 at 3:59 PM, Alec Taylor alec.tayl...@gmail.com wrote: Good evening, I am strongly considering building my

Re: [Rails] Build mobile apps for Rails sites — Would XML/JSON passing be the best approach?

2011-11-21 Thread Dhaval jain
Yeah its a good idea to open source. Go for it.will surely contribute to it. Regards Dhaval On Mon, Nov 21, 2011 at 6:06 PM, Alec Taylor alec.tayl...@gmail.com wrote: Sure, happy to use JSON as the format. I wouldn't want to use anything like PhoneGap, since I am also integrating hardware

[Rails] Problem with Asset Pipeline

2011-11-21 Thread Ben
I had a problem when I tried to upgrade from Rails 3.0 + Jammit to Rails 3.1 Asset Pipeline. I created app/assets folder, under it I have both javascripts/application.js.coffee and stylesheets/ application.css.scss. I included both using stylesheet_link_tag and javascript_include_tag, but it just

[Rails] Re: Problem with Asset Pipeline

2011-11-21 Thread Erwin
what's the content of your application.js application.css ? btw seems you don't need .css.scss extension, can write only .scss On Nov 21, 4:09 pm, Ben benzhe...@gmail.com wrote: I had a problem when I tried to upgrade from Rails 3.0 + Jammit to Rails 3.1 Asset Pipeline. I created

[Rails] [Rails ] inheritance template w namespace ..

2011-11-21 Thread Erwin
I have been using template inheritance wo any problem I have defined an :admins namespace ( used w Devise authentication) , so I have controllers defined in admins /admins /sessions_controller /plans_controller /categories_controller In my 'administration' layout I am using a

[Rails] Re: Problem with Asset Pipeline

2011-11-21 Thread Ben
The content in application.css.scss is /* *= require_self *= require_tree . */ The application.js.coffee is #= require jquery I am simply just to test out the new asset pipeline. As I said the application has no problem to load application.js, but it just cannot find the correct location of

[Rails] error when using generator

2011-11-21 Thread Allen A. Maxwell
I'm not sure what I've done - may have tried to roll my own on some things and missed some dependencies? Not sure. I thought it might have been something with my ubuntu install but I finally talked the boss into a macbook the other day and the results are the same on the mac so that wasn't it.

[Rails] Re: Problem with Asset Pipeline

2011-11-21 Thread Jeremy Woertink
In your config/application.rb do you have config.assets.enabled = true and in the config/environments/development.rb have config.assets.compress = false config.assets.debug = true I had a similar issue but forgot to add all this stuff. After adding it, mine started working Hope that helps,

[Rails] Re: Problem with Asset Pipeline

2011-11-21 Thread Ben
Hi, Jeremy, I have all these set up correctly. That is why the JS part is working, but the CSS part just does not work at all. It is really frustrating for me. Thanks a lot for your help anyway! On Nov 22, 1:49 am, Jeremy Woertink li...@ruby-forum.com wrote: In your config/application.rb do

[Rails] uninitialized constant Sass::Script::Functions::EvaluationContext

2011-11-21 Thread Mattia nil
Hi, after deploying a bunch of modifications to my web app... I get the error attached trying to load the page (see attached file). This is my environment.rb file: config.gem 'warden' config.gem 'devise', ~ 1.0.9 config.gem role_model config.gem formtastic, :version = ~ 0.9.10

[Rails] Understanding Asset Pipeline

2011-11-21 Thread Jeremy Woertink
ok, so I'm doing an upgrade on a rails 2.3.2 app to 3.1, and I've noticed a lot of roadblocks with the asset pipeline. Luckily I've figured them all out, but I'm wondering how everyone else is solving these issues. Let's take a newly generated rails 3.1 app. I have a grid of squares I want to

Re: [Rails] Understanding Asset Pipeline

2011-11-21 Thread Greg Reinacker
Here's what I do (on Rails 3.1.1 and later): /vendor/assets/javascripts/jquery-ui.js in application.js, add line //= require jquery-ui That gets the jquery-ui stuff working. Then, for my custom theme, I do the following: /app/assets/stylesheets/jquery-ui-1.8.13.custom.css (this is my custom

[Rails] Re: Understanding Asset Pipeline

2011-11-21 Thread Jeremy Woertink
hmm. Ok, in my app that I'm upgrading, I can't do require_tree . because of the 150 different stylesheets used currently. I should just be able to *= require jquery-ui1.8.13.custom, right? Now what about the whole thing of 3rd party stuff going into vendor/assets ? How do you deal with 3rd

Re: [Rails] Re: Understanding Asset Pipeline

2011-11-21 Thread Greg Reinacker
On Nov 21, 2011, at 11:51 AM, Jeremy Woertink wrote: hmm. Ok, in my app that I'm upgrading, I can't do require_tree . because of the 150 different stylesheets used currently. I should just be able to *= require jquery-ui1.8.13.custom, right? Yep, that should work fine. Now what about the

[Rails] Rspec response.should have_selector not matching

2011-11-21 Thread Greg
Hi all, I got some problems with my integration test. I have a form were a new user can sign up. If the form is blank and submitted the normal error occur. The error div has an id error_explanation. In my integration test i try to match it but the test is always red. Here some Code: #

Re: [Rails] Rspec response.should have_selector not matching

2011-11-21 Thread Greg
On 21.11.2011 20:24, Greg wrote: Hi all, I got some problems with my integration test. I have a form were a new user can sign up. If the form is blank and submitted the normal error occur. The error div has an id error_explanation. In my integration test i try to match it but the test is

[Rails] Re: uninitialized constant Sass::Script::Functions::EvaluationContext

2011-11-21 Thread Jeremy Woertink
did you already try config.gem 'sass-rails' ? -- 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-talk@googlegroups.com. To unsubscribe from this

[Rails] Re: Problem with Asset Pipeline

2011-11-21 Thread Jeremy Woertink
Is it rails 3.1.1 or 3.1.2 ? Did you change the config.assets.prefix at all? Is there still a stylesheets folder in your public folder? I actually have no idea at this point, so I'm hoping to spark something that allows you to figure it out :) -- Posted via http://www.ruby-forum.com/. --

[Rails] How to use two different sets of mailer templates for two different Devise models?

2011-11-21 Thread 99miles
I'm using Resque to send Devise emails. To do so I set: devise.rb config.mailer = Mailers::Devise::DeviseMailer But I have 2 devise models -- User and Client. I want to send different devise mailer templates for each. devise.rb says The first four configuration values can also be set straight

[Rails] Association - strange formatting

2011-11-21 Thread Remco Swoany
Hi, i have a simple association: Appartment: has_many :leads Lead: Belongs_to: appartment attr_accessible :appartment_id On the appartment show method a partial is include with a lead-form. semantic_form_for @lead do |f| f.input :firstname f.input :lastname f.input :appartment, :as =

Re: [Rails] Association - strange formatting

2011-11-21 Thread Colin Law
On 21 November 2011 21:19, Remco Swoany li...@ruby-forum.com wrote: Hi, i have a simple association: Appartment: has_many :leads Lead: Belongs_to: appartment attr_accessible :appartment_id On the appartment show method a partial is include with a lead-form. semantic_form_for @lead do

[Rails] Getting the most of our caches when dealing with external HTTP services

2011-11-21 Thread Matthijs Langenberg
Dear all, I am dealing with a group of pages that display data from a few different HTTP resources. In order to get these pages to be performant you must understand that I want to cache as much as possible at the front of my Rails application. Another requirement is that we never show stale data

[Rails] Re: Nested Attributes and Radio Buttons -- any way to do this?

2011-11-21 Thread Samantha John
I'd recommend creating an attr_accessor for :primary on your Title model. In your form you could do something like: f.object.roles.each do |role| f.radio_button :primary, :role.id f.label :primary which should have the desired behavior. -- Posted via http://www.ruby-forum.com/. -- You

[Rails] PDF-Barcode-Background process questions

2011-11-21 Thread tmueller
Hello Everyone, I have been lurking here for awhile and now have some questions to ask the group. I am rewriting an application from .NET and was wondering on what gems to use and also advice on how to approach a couple of things architecturally. - Best PDF component? Prawn? I will need to embed

[Rails] ActiveRecord :dependent fails for me

2011-11-21 Thread RubyNewbie
I have a simple has_many relationship between a Movie and its Previews. I've verified that the previews table has a foreign key to its parent record in the movies table. I've added the has_many with a :dependent = :delete_all as an option on the has_many association. The problem I'm seeing is

[Rails] Re: error when using generator

2011-11-21 Thread Max
it looks like i got this fixed. I walked back into my git repo until i found a commit that didn't have the error. as it turned out the problem was with the prototype gem. i had it in the Gemfile as gem 'prototype' after googling etc I found that changing it to gem 'prototype-rails' did the

[Rails] table naming

2011-11-21 Thread CC Chen
I upload a file such as EX12345.txt and I want to save the file content into database. The table name I want to call EX12345.(Don't create by myself) Does it can work or have other good idea? Thanks, -- Posted via http://www.ruby-forum.com/. -- You received this message because you are

[Rails] Re: Problem with Asset Pipeline

2011-11-21 Thread Ben
It is Rails 3.1.1. I use default for config.assets.prefix I removed stylesheets folder from public folder though. On Nov 22, 4:06 am, Jeremy Woertink li...@ruby-forum.com wrote: Is it rails 3.1.1 or 3.1.2 ? Did you change the config.assets.prefix at all? Is there still a stylesheets folder in

Re: [Rails] existing application with mysql migration

2011-11-21 Thread amvis
Thank all.. I am fed up with so many gems problems to running one ruby on rails application , which use ruby 1.8.7 and rails 2.3.6. so some gems which related with 2.3.6 not getting now a days. we just change to 2.3.11 in *(environment.rb). *and when i run* bundle instal*l command, which

[Rails] gems problem with ruby on rails application

2011-11-21 Thread amvis
I am fed up with so many gems problems to running one ruby on rails application , which use ruby 1.8.7 and rails 2.3.6. so some gems which related with 2.3.6 not getting now a days. we just change to 2.3.11 in * (environment.rb). *and when i run* bundle instal*l command, which shows* could