[Rails] problem installing 'eventmachine' gem

2011-10-21 Thread Tomas R.
i get this error https://gist.github.com/1305417 -- 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: iphone and android with RoR 3.x

2011-08-27 Thread Tomas R.
RoR is for building web app, for smartphones app you should learn java i think. But any web app build with RoR will work on a smartphone using the internet browser. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on

[Rails] Re: sessions store

2011-08-14 Thread Tomas R.
i dont need the cookie for the current user, but for every user. So a user can see if someone else is connected or not -- 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, sen

[Rails] Re: sessions store

2011-08-13 Thread Tomas R.
if cookies is permanent i cant verify if signed in is true or false -- 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 uns

[Rails] Re: sessions store

2011-08-13 Thread Tomas R.
how could I get if a user if connected or not? -- 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 gr

[Rails] Re: Sqlite 3 install error on Heroku, Rails 3.1

2011-08-13 Thread Tomas R.
inside gemfile gem 'sqlite3', :group => [:development, :test] gem 'pg', :group => [:production] -- 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-

[Rails] sessions store

2011-08-13 Thread Tomas R.
i have some questions about sessions store, actually im using cookie based authentication. But i need a way to know if someone is logged in or not, so that's why i need DB store sessions, but my question is, is the a way of making this sessions expire like cookies, or beeing permanent as cookies? i

[Rails] how does force_ssl works (Rails 3.1)

2011-08-10 Thread Tomas R.
how does force_ssl inside a controller works, it just work for the current controller actions? becouse I place force_ssl inside my sessions controller and everytime I access to any action of it I start navigating throw https on my whole page not only inside sessions controller. -- Posted via http

[Rails] Re: Sqlite 3 install error on Heroku, Rails 3.1

2011-08-10 Thread Tomas R.
if using Rails 3.1 add gem 'pg', :group => :production gem 'pg', :group => [:development, :test] into gemfile -- 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] Adding elementos into a collection

2011-08-09 Thread Tomas R.
So I have this Event has_many :assistance has_many :users, :through => :assistance User has_many :assistance has_many :assisted_events, :through => :assistance, :source => :assistance Assistance belongs_to :user belongs_to :event Users assisting to events are assigned using @event.

[Rails] Re: weird problem when updating to RC5

2011-08-08 Thread Tomas R.
so its a problem with arel 2.1.5, thanks for the tip -- 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 t

[Rails] weird problem when updating to RC5

2011-08-08 Thread Tomas R.
i updated from RC4 to RC5 (3.1) and everytime I do SomeModel.all, .first, anything I get something like this ActionView::Template::Error (undefined method `visitor' for #): PostgreSQLAdapter or SQLiteAdapter -- Posted via http://www.ruby-forum.com/. -- You received this message because you ar

[Rails] Re: Rails 3.1 CoffeeScript not working

2011-07-23 Thread Tomas R.
I found the problem, a jquery plugin isnt loading well. Uncaught TypeError: undefined is not a function but it was working after rails 3.1, is beeing loaded at the end of the file so it should be ok (bubblepopup plugin) -- Posted via http://www.ruby-forum.com/. -- You received this message

[Rails] Re: Rails 3.1 CoffeeScript not working

2011-07-23 Thread Tomas R.
Peter De Berdt wrote in post #1012552: > On 23 Jul 2011, at 08:01, Martin Wawrusch wrote: > >> Try >> >> $ -> >> $('#events a').lightBox() >> $("#slider").easySlider >> auto: true >> continuous: true >> >> There is an online js to coffeescript converter out there, I just >> can't fi

[Rails] Rails 3.1 CoffeeScript not working

2011-07-22 Thread Tomas R.
I convert my old JS files into CoffeeScript, In my public controller I used this functions $('#events a').lightBox() $(document).ready -> $("#slider").easySlider auto: true, continuous: true they load inside application.js like this (function() { $('#events a').lightBox(); $(docu

[Rails] Re: set user IP on create

2011-07-21 Thread Tomas R.
Tim Shaffer wrote in post #1012223: > Assigning it in the controller is probably the best bet: > > instance = Model.new(params[:model]) > instance.ip_address = request.ip_address I will do it then, thanks -- Posted via http://www.ruby-forum.com/. -- You received this message because you are su

[Rails] Re: set user IP on create

2011-07-21 Thread Tomas R.
so how should I add the IP? assign it on the controller or maybe a hidden text field? -- 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@googl

[Rails] set user IP on create

2011-07-21 Thread Tomas R.
i tried to make a callback to assign the user IP address on create before_create self.ip = request.remote_ip end but I get NameError (undefined local variable or method `request' for #): -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the

[Rails] Re: UJS guides somewhere?

2011-05-24 Thread Tomas R.
so before trying ajax i need to learn javascript right? -- 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 fro

[Rails] UJS guides somewhere?

2011-05-23 Thread Tomas R.
I'm trying to work with AJAX on Rails 3 but I cant find any documentation or a guide for learning it, is there a good one out there to start practicing? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"

[Rails] Re: Mac OSX Leopard + rails3 problems

2011-05-22 Thread Tomas R.
thanks you guy rubygems 1.8.2 runs just perfect sudo gem update --system 1.8.2 -- 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

[Rails] Mac OSX Leopard + rails3 problems

2011-05-21 Thread Tomas R.
I Just installed ruby 1.8.7, rubygems 1.8.3 i think and Rails 3.0.7 and I get this messages everywhere tomas$ rails s NOTE: Gem::Specification#has_rdoc= is deprecated with no replacement. It will be removed on or after 2011-10-01. Gem::Specification#has_rdoc= called from /opt/local/lib/ruby/gems/

[Rails] Re: Nested object problems

2011-05-15 Thread Tomas R.
Fixed: Changed @user.build_profile from view to controller -- 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

[Rails] Re: Nested object problems

2011-05-15 Thread Tomas R.
I added that line but still dont work User Form <%= form_for @user do |f| %> <%= render 'shared/error_messages', :record => @user %> >>> Some Field Tags <<< <%= f.fields_for @user.build_profile do |builder| %> <%= render 'profile_form', :f => builder %> <% end %> <%= f.submit (@user

[Rails] Nested object problems

2011-05-14 Thread Tomas R.
Im making nested attributes for profile on the user model and I also need to validate the profile info so I put User model has_one :profile accepts_nested_attributes_for :profile validates_associated :profile <--- To validate values attr_accessible :profile

[Rails] Re: Secure ways of doing this

2011-05-13 Thread Tomas R.
Ok I get it now. -- 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 group, send email to rubyonrail

[Rails] Re: Secure ways of doing this

2011-05-13 Thread Tomas R.
what if someone set article_id = 100 and article with id 100 doesnt exists -- 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@googlegro

[Rails] Re: Secure ways of doing this

2011-05-13 Thread Tomas R.
Tim Shaffer wrote in post #998504: > You're right. > > How do you determine that a user has access to add a comment to a > specific > article? That's the logic that you should put in you controller/model. > > So if the user changes the article ID in the URL to an article that he > doesn't have acce

[Rails] Re: Secure ways of doing this

2011-05-13 Thread Tomas R.
using a hidde_field shows the value to the user through source code and using GET can make users change the value from the URL -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this gro

[Rails] Secure ways of doing this

2011-05-13 Thread Tomas R.
Which is the best way of doing this I have an Article show page with a post form so when submitting the post I give the article_id argument to the post create method in a different controller. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to

[Rails] Getting null value when it's assigned

2011-05-10 Thread Tomas R.
I have my articles migration create_table :articles do |t| t.integer :category_id, :null => false etc.. and my form Select a category <%= f.select :category_id, Category.all.collect {|category| [category.name, category.id ]} %> But everytime im sending that info im getting a nil value for categ

[Rails] Weird problems

2011-05-05 Thread Tomas R.
I just install rails for Ruby 1.9.2 running from Ubuntu 11.04 but everytime i try to Rails S or bundle install I get NOTE: Gem::SourceIndex#all_gems is deprecated with no replacement. It will be removed on or after 2011-10-01. Gem::SourceIndex#all_gems called from /usr/local/lib/ruby/gems/1.9.1/g

[Rails] Users has_many Users (friends)

2011-04-26 Thread Tomas R.
How can I use a User has_many Users? my model is called Friends user_id friend_id so a User can add a User as a friend -- 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

[Rails] need some help with routes maybe

2011-04-21 Thread Tomas R.
Im making a Cart for my site, so I make Orders Controller to manage Orders so inside I do def add_product @product = Product.find(params[:id]) @order = Order.find_by_client_id(current_user.id) @order.products << @product end on Product view/show I place <%= link_to t(:add_to_cart

[Rails] Re: Problem with new action 'validate'

2011-04-18 Thread Tomas R.
so you say that should be form_for params[:key]? that wont work neither -- 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

[Rails] Problem with new action 'validate'

2011-04-17 Thread Jose tomas R.
I've created a new action in my invitations controller named validate and validation controller/invitations_controller.rb def validate end def validation @invitation = Invitation.find(params(:key)) if @invitation != nil redirect_to new_client_path, :notice => 'Codigo Aceptado' else fl

[Rails] Re: Re: Get a value from previous page

2011-01-06 Thread Jose tomas R.
Colin Law wrote in post #972821: > On 6 January 2011 14:25, Jose tomas R. wrote: > > Please quote the previous message and insert your comments at the > appropriate point, this makes it easier to follow the thread. > >> I dont need @order ar params I need it as a value > &

[Rails] Re: Get a value from previous page

2011-01-06 Thread Jose tomas R.
I dont need @order ar params I need it as a value -- 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

[Rails] Re: Get a value from previous page

2011-01-04 Thread Jose tomas R.
i need something like this index.html.erb <%= link_to 'cost', :action => 'search', :order => 'cost' %> cars_controller.rb def search @order = :order @cars = Car.paginate :page => params[:page], :order => @order respond_to do |format| format.html # index.html.erb format.x

[Rails] Re: Get a value from previous page

2011-01-04 Thread Jose tomas R.
what [b] [/b] :S -- 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 rubyonrail

[Rails] Re: Get a value from previous page

2011-01-03 Thread Jose tomas R.
i need something like this index.html.erb <%= link_to 'cost', :action => 'search', [b]:order[/b] => 'cost' %> cars_controller.rb def search @order = [b]:order[/b] @cars = Car.paginate :page => params[:page], :order => @order respond_to do |format| format.html # index.html.erb

[Rails] Get a value from previous page

2011-01-02 Thread Jose tomas R.
how could i get a value from previus page? for example on EVENT show view i have <%= link_to 'New Message', new_message_path( :event_id => @event.id) %> | and i need to get the event id on the new_message page to send it when creating the message -- Posted via http://www.ruby-forum.com/. --

[Rails] Re: Problem with Command Prompt

2010-12-16 Thread Jose tomas R.
sorry didnt know why it didnt work earlier thanks -- 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

[Rails] Problem with Command Prompt

2010-12-16 Thread Jose tomas R.
Im running ROR on my laptop, but i also work on my desktop pc, so i decide to move my proyect to a USB flashdrive, but when im trying to cd my E:\ drive i cant do it, im running windows XP on both. is there a command to change drive or is this not possible? -- Posted via http://www.ruby-forum.com

[Rails] Re: Re: Troubles getting :id

2010-11-21 Thread Jose tomas R.
Colin Law wrote in post #962926: > On 21 November 2010 13:01, Jose tomas R. wrote: >> wow, that was easy to fix. it's ".id" cause i need just the product ID >> thanks for your help and advice > > Please quote previous message when replying, it makes it easie

[Rails] Re: syntax error

2010-11-21 Thread Jose tomas R.
thanks -- 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 rubyonrails-talk+uns

[Rails] Re: syntax error

2010-11-21 Thread Jose tomas R.
i put it like a helper on AplicationController but still doesnt work -- 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 un

[Rails] Re: Troubles getting :id

2010-11-21 Thread Jose tomas R.
wow, that was easy to fix. it's ".id" cause i need just the product ID thanks for your help and advice -- 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 rubyon

[Rails] Troubles getting :id

2010-11-20 Thread Jose tomas R.
im using <%= button_to 'Rent', :controller => 'transaction' , :action => 'rent', :id => @product.id %> on ProductsController to pass an :id to a TransactionController but when searching for the product's id def load_product @product = Product.find(:id).id end i get Couldn't find Product

[Rails] Re: syntax error

2010-11-20 Thread Jose tomas R.
i notice, thanks i use that line too mucho on my code so i made on ApplicationControlller def privilege (session[:user_id].exist? && session[:user_id].privilege == 50) ? true : false end and on the actual page i put <%= :privilege ? link_to('Edit', edit_product_path(product)) : "" %>

[Rails] syntax error, unexpected tSTRING_BEG

2010-11-20 Thread Jose tomas R.
Rails is throwing this error C:/Ruby/Depot/app/views/products/index.html.erb:28: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '(' ...er.privilege == 50 ? {link_to 'Show', product} : 'a' );@out... in line <%= current_user.privilege == 50 ? {link_to 'Show', product} : 'a'