[Rails] issues with rest client api

2012-02-23 Thread amvis
Here i am trying to pass one ID with the url, but that ID didn't append with URL... *def retrieve* *url = "http://localhost:3000/branches/"* *resource = RestClient::Resource.new url+$param["id"]* *puts resource* *end * * * giving ID via commend line that is * * *ruby newrest.rb id="

[Rails] Re: Accessing array elements directly in Rails translations

2012-02-23 Thread Alex Duck
On Feb 23, 10:14 pm, Valery Kvon wrote: > On 24.02.2012, at 1:12, Alex Duck wrote: > > > On Feb 23, 9:42 pm, Valery Kvon wrote: > >> On 24.02.2012, at 0:26, Alex Duck wrote: > > >>>    phones: > >>>      - (123) 456-7890 > >>>      - +1987654321 > >>>      - 1-890-123-456 > > >> Try to quote them

[Rails] Re: Jasper reports and iReport

2012-02-23 Thread anusha c.
Herman Jansen wrote in post #628820: > I still have to try the suggestion from Fred but I got it to work on > my development machine. I had to jump through some loops, but it does > work. > I can now develop and test a report with iReport and call it from Ruby > on Rails. > If anyone is interested

Re: [Rails] Devise generates Mailer by its own?

2012-02-23 Thread Dev Guy
Hi you might want to ask this on the devise mailing list, you can find it here https://groups.google.com/group/plataformatec-devise Cheers! On Thu, Feb 23, 2012 at 9:58 PM, Soichi Ishida wrote: > Rails 3.1.3 > > Hi. I'm a little confused with Devise and ActionMailer. > > It seems that Devise ha

[Rails] Re: Getting error, 'NoMethodError in PostsController#create' , manytomany relation

2012-02-23 Thread gmspro gmspro
John H. wrote in post #1048579: > This is an issue at the model / db layer. To help, we'd need the model > code > and the contents of params[:data] I have added the model relation, and this is the params[:data] "data"=>{"title"=>"Linux Developers In High Demand: Report", "content"=>"The Linux Fo

[Rails] Re: how to append to models errors collection?

2012-02-23 Thread John Hinnegan
puts, awesome print, pry, ruby-debug are all great tools you might try before bringing this up on the list: Try: @user.errors each do |e| puts @post puts @post.errors puts @post.errors.class @post.errors << e end unless @user.valid? then run your test again. -- You received this messa

[Rails] Re: Getting error, 'NoMethodError in PostsController#create' , manytomany relation

2012-02-23 Thread John Hinnegan
This is an issue at the model / db layer. To help, we'd need the model code and the contents of params[:data] -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyo

Re: [Rails] Re: How to call javascript method from controller or by Ajax?

2012-02-23 Thread Benjamin Iandavid Rodriguez
you can simplify this by setting the respond_to at the top of your controller example: class SomeController < ApplicationController respond_to :html, :json, :js and then inside your actions you just pass the param to a respond_with: def some_action respond_with @some_var end 2012/2/23 subbarao

[Rails] how to append to models errors collection?

2012-02-23 Thread S Ahmed
I want to append to my models error collection from another models errors like: @user.errors each do |e| @post.errors << e end unless @user.valid? But it says: 'undefined method << for activemodel post . What is errors then, a hash? -- You received this message because you are subscri

[Rails] Getting error, 'NoMethodError in PostsController#create' , manytomany relation

2012-02-23 Thread gmspro gmspro
This is the form: Add post <%= form_tag :controller=>'posts', :action=>'create' do %> <%= label :q, :Title %> <%= text_field :data, :title, :class => :addtextsize %> <%= label :q, :Content %> <%= text_area :data, :content, :rows=>10 , :class => :addtextarea %> <%= label :q, :Tags %>

Re: [Rails] Re: How to call javascript method from controller or by Ajax?

2012-02-23 Thread subbarao
On 02/24/2012 02:41 AM, Robert Walker wrote: testwishluck wrote in post #1048151: Hi guys, In Rails framework, I need to call the lightbox to add payment method by using javascript method AuthorizeNetPopup.openAddPaymentPopup(). But based on the design, the popup should be triggered by other wa

[Rails] Devise generates Mailer by its own?

2012-02-23 Thread Soichi Ishida
Rails 3.1.3 Hi. I'm a little confused with Devise and ActionMailer. It seems that Devise has its own way of sending mails through ActionMailer. Does it generate Mailer class when "rails g devise..." command is executed? Or do I need to do some special command in order to generate Mailer? I have

[Rails] Disable "find" (in favor of find_each)

2012-02-23 Thread John Hinnegan
I have a table that is large, and I work for a growing company. We will use find_each or find_each_in_batches, but as our code base grows and the number of hands touching the code increases, I'm concerned that we may risk releasing code that will perform terribly in production. Our test envir

[Rails] Re: Problems with background-* - css

2012-02-23 Thread Felipe Pieretti Umpierre
thats right, just put the asset_path( "myImage.jpg" ) to a full URI Thanks for all! -- 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@googleg

[Rails] Re: odd behaviour with postgresql and rails 3?

2012-02-23 Thread Dev Guy
OK I narrowed it down to user error, nothing is wrong! On Thu, Feb 23, 2012 at 8:07 PM, Dev Guy wrote: > Hi I am seeing something odd with my postgresql database with Rails 3, > there is one model I can't update from Rails. From the rails console I > can update other models, but not this particul

[Rails] Re: Issues with template encoding (invalid byte sequence in UTF-8):

2012-02-23 Thread Mex Noob Yes
I figured out what it was (but i have no clue why) it was not the whole content but just title="<%= CGI.unescape( entry[:original_url] )" taking out this fixed the whole problem... kinda makes sense to me, but it is still kinda crazy... hope someone finds this if they get this in their way too a

[Rails] Re: Best Way to Execute Ruby Scripts via HTTP Requests?

2012-02-23 Thread Frank Guerino
Thanks Philip! I didn't know that Rails could be used to execute Job-like processes. This is great info! I wish the Rails marketing documentation would publicize this info more. My Best, Frank -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribe

[Rails] odd behaviour with postgresql and rails 3?

2012-02-23 Thread Dev Guy
Hi I am seeing something odd with my postgresql database with Rails 3, there is one model I can't update from Rails. From the rails console I can update other models, but not this particular model. The model is simple, I can create a records, but after this I can't update a record. It was working

Re: [Rails] private 'new' method???

2012-02-23 Thread Dave Aronson
On Thu, Feb 23, 2012 at 17:41, Bruno Meira wrote: > My application suddenly started to give this message. > NoMethodError: private method `new' called for Post.class > > my post class has: > class Post < ActiveRecord::Base >    belongs_to :user >     ... > end The problem is probably somewhere i

Re: [Rails] Issues with template encoding (invalid byte sequence in UTF-8):

2012-02-23 Thread Javier Quarite
Have you tried in the beginning of the file # encoding: UTF-8 It works for me Javier Q. -- 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 gr

Re: [Rails] Issues with template encoding (invalid byte sequence in UTF-8):

2012-02-23 Thread Jeffrey L. Taylor
The template is likely UTF-8, but the information from the database, e.g. entry[:original_url] is likely ASCII-8BIT if you are using MySQL and the mysql adapter, assuming your tables are UTF-8. Try using the mysql2 adapter instead. IIRC, install the mysql2 gem and change all 'adapter: mysql' in c

Re: [Rails] Re: Problems with background-* - css

2012-02-23 Thread Javier Quarite
On Thu, Feb 23, 2012 at 5:44 PM, Felipe Pieretti Umpierre < li...@ruby-forum.com> wrote: > Hello Paul, I made what you say: > > main.css.erb > > body {background: url( <%= asset_path "images/bg.jpg" %> ) fixed > no-repeat; width:100%; height:100%; -webkit-background-size: cover; > -moz-background

[Rails] Question About Incremental and Ongoing Seeding of Database Throughout Application Life Cycle

2012-02-23 Thread Frank Guerino
Hi, I have a question about how best to handle "ongoing" and "incremental" seeding of a database, after the application is built. Summary of Application: I need to build a multiple choice testing application where, in short, each Question has four Answer Choices. A "User Specific Test" will cons

[Rails] Re: private 'new' method???

2012-02-23 Thread Bruno Meira
That's the exception Rails console gave me: 1.9.2p290 :035 > post = Post.new NoMethodError: private method `new' called for Post:Class from /home/bruno/.rvm/gems/ruby-1.9.2-p290/gems/actionmailer-3.1.3/lib/action_mailer/base.rb:455:in `method_missing' from (irb):35 from

[Rails] App generator for Rails 3

2012-02-23 Thread Marco Mastrodonato
I would like to know what you think about my little work, any advice is welcome, thanks http://en-marcomastrodonato.blogspot.com/2012/02/leonardo-update-to-110-version.html -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "R

[Rails] Re: Problems with background-* - css

2012-02-23 Thread Felipe Pieretti Umpierre
Hello Paul, I made what you say: main.css.erb body {background: url( <%= asset_path "images/bg.jpg" %> ) fixed no-repeat; width:100%; height:100%; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover;} but still not showing my backgro

[Rails] private 'new' method???

2012-02-23 Thread Bruno Meira
Hi guys, My application suddenly started to give this message. NoMethodError: private method `new' called for Post.class my post class has: class Post < ActiveRecord::Base belongs_to :user ... end How could I fix this problem? I'm using rails 3.1.3 even if I tried to write Post.new in co

[Rails] Issues with template encoding (invalid byte sequence in UTF-8):

2012-02-23 Thread Mex Noob Yes
Well i have tried to find the answer by myself and i had no luck at all, so here it is: i have followed all the tips i have found here and there, putting <% # coding: UTF-8 %> using encode and force_encoding even trying some wacky regex i came up with (which of course was a dumb idea) i am using

[Rails] Unit testing models for legacy tables

2012-02-23 Thread Tamara K.
Hello, I have an application that needs to access legacy tables that are in a different database then the Rails application. I know how to set up the models to connect to the legacy tables and that seems to work just fine. I would like to do unit testing on these models using Rails built in testi

[Rails] Re: parameter values

2012-02-23 Thread M.SH
thanks for all but Colin is the right answer for me i have try it Colin ++ :) On Feb 23, 11:33 pm, Colin Law wrote: > On 23 February 2012 21:18, M.SH wrote: > > > thank u for your reply, > > i mean by name like > > > >   > >   > > use > > > and I think you will get them as an array in params[

Re: [Rails] Re: parameter values

2012-02-23 Thread Colin Law
On 23 February 2012 21:18, M.SH wrote: > thank u for your reply, > i mean by name like > >   >   use and I think you will get them as an array in params[:street] Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this

Re: [Rails] parameter values

2012-02-23 Thread Hassan Schroeder
On Thu, Feb 23, 2012 at 12:54 PM, Valery Kvon wrote: > Rails' approach: each key is unique. > Philosophy. Counter-philosophy -- Be liberal in what you accept, and conservative in what you send. (Postel's Law) Silently discarding data from a client is not, to my mind, a good thing. To

[Rails] Re: parameter values

2012-02-23 Thread M.SH
thank u for your reply, i mean by name like . . i don't know the no. of elements On Feb 23, 10:34 pm, Valery Kvon wrote: > On 24.02.2012, at 0:20, M.SH wrote: > > > Hi all, > > i'm a bigginer in rails, i used before a j2ee > > there was a method > >      request.getParameterValues(par

Re: [Rails] Accessing array elements directly in Rails translations

2012-02-23 Thread Valery Kvon
On 24.02.2012, at 1:12, Alex Duck wrote: > On Feb 23, 9:42 pm, Valery Kvon wrote: >> On 24.02.2012, at 0:26, Alex Duck wrote: >> >> >> >>>phones: >>> - (123) 456-7890 >>> - +1987654321 >>> - 1-890-123-456 >> >> Try to quote them > > Quote them how? Can you give an example

[Rails] Re: Accessing array elements directly in Rails translations

2012-02-23 Thread Alex Duck
On Feb 23, 9:42 pm, Valery Kvon wrote: > On 24.02.2012, at 0:26, Alex Duck wrote: > > > > >    phones: > >      - (123) 456-7890 > >      - +1987654321 > >      - 1-890-123-456 > > Try to quote them Quote them how? Can you give an example please? -- You received this message because you are sub

[Rails] Re: How to call javascript method from controller or by Ajax?

2012-02-23 Thread Robert Walker
testwishluck wrote in post #1048151: > Hi guys, > > In Rails framework, I need to call the lightbox to add payment method > by using javascript method AuthorizeNetPopup.openAddPaymentPopup(). > But based on the design, the popup should be triggered by other ways > not by clicking the normal button.

Re: [Rails] parameter values

2012-02-23 Thread Valery Kvon
On 24.02.2012, at 0:48, Hassan Schroeder wrote: > Exactly what he said -- the same name. > > This: http://example.com/?foo=bar&foo=baz&foo=xyz Unacceptable :) Rails' approach: each key is unique. If you want to get them grouped, just wrap them to array, and your params accessor will be lik

Re: [Rails] parameter values

2012-02-23 Thread Hassan Schroeder
On Thu, Feb 23, 2012 at 12:34 PM, Valery Kvon wrote: >>      request.getParameterValues(param_name) >> that return array of parameters values than have the same name > What exactly do you mean 'the same name' ? Exactly what he said -- the same name. This: http://example.com/?foo=bar&foo=baz&

Re: [Rails] Accessing array elements directly in Rails translations

2012-02-23 Thread Valery Kvon
On 24.02.2012, at 0:26, Alex Duck wrote: > >phones: > - (123) 456-7890 > - +1987654321 > - 1-890-123-456 > Try to quote them -- 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 rubyo

Re: [Rails] parameter values

2012-02-23 Thread Valery Kvon
On 24.02.2012, at 0:20, M.SH wrote: > Hi all, > i'm a bigginer in rails, i used before a j2ee > there was a method > request.getParameterValues(param_name) > that return array of parameters values than have the same name > > is there like that method in rails What exactly do you mean 'the

[Rails] Accessing array elements directly in Rails translations

2012-02-23 Thread Alex Duck
Is it possible to access array elements directly with Rails's t() helper? For example, if I have this translation defined in my YAML file en: contact_page: title: Contact us phones: - (123) 456-7890 - +1987654321 - 1-890-123-456 Then in my view, how can I get to inter

[Rails] parameter values

2012-02-23 Thread M.SH
Hi all, i'm a bigginer in rails, i used before a j2ee there was a method request.getParameterValues(param_name) that return array of parameters values than have the same name is there like that method in rails Thanks M.SH -- You received this message because you are subscribed to the Goog

Re: [Rails] [ANN] Rails 3.2.2.rc1, 3.1.4.rc1, and 3.0.12.rc1 have been released!

2012-02-23 Thread Peter Vandenabeele
On Wed, Feb 22, 2012 at 11:03 PM, Aaron Patterson wrote: > Hi everyone, > > I just released the following Rails release candidates: > > * 3.2.2.rc1 > * 3.1.4.rc1 > * 3.0.12.rc1 > > Please give these releases a try! I tried 3.2.2.rc1 with bundle update (free versions on nearly all gems) and al

[Rails] Re: Re: Undefined Method

2012-02-23 Thread Roger Patrick
> def index > games_relation = case params[:console].present? > when true then Game.where(:console => params[:console]) > else Game > end > @games = games_relation.paginate(:per_page => 4, :page => > params[:page]).search(params[:search]) > end Thank you very much, that has solved my pro

Re: [Rails] Re: Undefined Method

2012-02-23 Thread Valery Kvon
On 23.02.2012, at 23:15, Roger Patrick wrote: >> > def index > @games = games_relation.paginate(:per_page => 4, :page => > params[:page]).search(params[:search]) > end > > in my game.rb file I will have the following: > > games_relation = case params[:console].present? > when true then Game.wh

[Rails] Re: Undefined Method

2012-02-23 Thread Roger Patrick
Valery Kvon wrote in post #1048505: > On 23.02.2012, at 22:23, Roger Patrick wrote: > >> website I receive the following error message which I assume is to say >> activerecord is not connecting: >> >> undefined method `find_by_console' for >> # > > At first, .find_by_ is a ActiveRecord::Relation's

Re: [Rails] How do I test for a redirect with RSpec?

2012-02-23 Thread Jason Fleetwood-Boldt
Two tips: 1) You can tail the test log (tail -f log/test/log). This will show you which controller & action is actually being hit by your test -- it is likely that this action isn't getting hit. 2) Try the debugger! Put "debugger" right after def registered_user, then make sure 'ruby-debug'

Re: [Rails] Undefined Method

2012-02-23 Thread Valery Kvon
On 23.02.2012, at 22:23, Roger Patrick wrote: > Now in my gamescontroller I have the following in my index: > > def index >@games = Game.paginate(:per_page => 4, :page => > params[:page]).search(params[:search]) >@games = @games.find_by_console(params[:console]) unless > params[:console

[Rails] Undefined Method

2012-02-23 Thread Roger Patrick
Hi all, I am currently trying to get a bunch of links to to display all the related console records upon button click so e.g. If a user clicks on the Dreamcast link then I would like it to display all records that have Dreamcast stored as their console. I have the following example code in my ind

Re: [Rails] validate :on not working

2012-02-23 Thread Valery Kvon
> so I wrote : > validates :location, :location => { :on => :create } > why don't you write: validates :location, :on => :create -- 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@go

[Rails] Re: PDF Creation Best Practise

2012-02-23 Thread Farrel
Not in usage with Rails directly. I've had to hack a messy API to generate PDF documents from an ERB template. There might be some better publicly available Ruby/LaTeX APIs out there I did this a few years ago. Farrel -- You received this message because you are subscribed to the Google Group

[Rails] Re: list of gems with demo

2012-02-23 Thread LED
On Feb 24, 1:37 am, Walter Lee Davis wrote: > On Feb 23, 2012, at 12:26 PM, LED wrote: > > > uhm im new in ruby on rails programming and i must say im learning and > > amaze by its framework im just wondering if thus anyone know a site or > > app with list of gems with demo or example of the gem

Re: [Rails] list of gems with demo

2012-02-23 Thread Walter Lee Davis
On Feb 23, 2012, at 12:26 PM, LED wrote: > uhm im new in ruby on rails programming and i must say im learning and > amaze by its framework im just wondering if thus anyone know a site or > app with list of gems with demo or example of the gem on it, like > example liked in github or other reposit

[Rails] list of gems with demo

2012-02-23 Thread LED
uhm im new in ruby on rails programming and i must say im learning and amaze by its framework im just wondering if thus anyone know a site or app with list of gems with demo or example of the gem on it, like example liked in github or other repository sites? -- You received this message because y

[Rails] How do I test for a redirect with RSpec?

2012-02-23 Thread Mohamad El-Husseini
I'm following the new version of Rails Tutorial. Chapter 9, exercise 5asks to ensure that registered users can not access the new and create methods in the users controller: S

[Rails] Re: how to create new documents?

2012-02-23 Thread Robert Walker
Msan Msan wrote in post #1048192: > My clients asking me the possibility to create every time new > documents, just like using text editors like word or others. > My application create a document model based on data inserted in a > form, obviously this is a static document that the user can print.

Re: [Rails] Problems with background-* - css

2012-02-23 Thread Paul Lopez
yes right - how about with .erb extension and use asset_path() for example: background: ulr(<%= asset_path('bg.png') %>); On Thu, Feb 23, 2012 at 2:45 PM, Brynjolfur Thorvardsson wrote: > Hi, sorry I should have read your post properly. I've had similar > problems, the path to the images i

[Rails] Re: Need help with routing problem

2012-02-23 Thread simpleton
Hi Ryan I've solved this. I had to remove the matched routes from the devise_for block and I had a get '/dashboard/index' on top of my routes file. Thanks -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email

[Rails] Search by Console

2012-02-23 Thread Roger Patrick
Hi all, I am currently trying to get a bunch of links to to display all the related console records upon button click so e.g. If a user clicks on the Dreamcast link then I would like it to display all records that have Dreamcast stored as their console. I have the following example code in my ind

Re: [Rails] Need help with routing problem

2012-02-23 Thread Ryan Cheung
Try to use 'rake routes' command to figure out the valid routes currently you have. If any valid routes was added to the routes.rb file, you'll see it. -- Best Regards, Ryan Cheung On Thu, Feb 23, 2012 at 5:53 PM, simpleton wrote: > I have a devise model called admin which gives me current_adm

[Rails] Re: validate :on not working

2012-02-23 Thread Erwin
FORGET ... SOLVED I found a validates :name, :subject, :location, :description, :presence => true few lines above ! so the presence validation should be updated too On 23 fév, 12:26, Erwin wrote: > [Rails 3.2.1, Ruby 1.9.3] > > in a Project model > I am trying to modify the :location at

[Rails] validate :on not working

2012-02-23 Thread Erwin
[Rails 3.2.1, Ruby 1.9.3] in a Project model I am trying to modify the :location attribute validation ( specific LocationValidator using Geocoder..) I need now to set it on create only so I wrote : validates :location, :location => { :on => :create } but when I update the project instance

[Rails] how to pass various methods in paper_trail gem in ruby

2012-02-23 Thread malar
I'm using paper_trail gem in ruby. The "versions" table table has created.From that cannot able to access various methods as (reify,originator, ...etc..,) in rails application. I Migrated the column for these methods .Also addes these specifications in models. Why i can't get trouble here. Also ho

[Rails] Need help with routing problem

2012-02-23 Thread simpleton
I have a devise model called admin which gives me current_admin and the model has a method called role, which is either 'free' or 'standard' or 'premium'. I have a dashboard_controller with three actions: def index ... end def free ... end def premium ... end I have a passthrough_controller that

[Rails] Re: Rendering in controllers vs rendering in views

2012-02-23 Thread Alexey
I have already received responses here: http://railsforum.com/viewtopic.php?id=47996 -- 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 group,