Questions tagged as 'ruby-on-rails'

1
answer

What is attr_accessor in Ruby?

I'm learning Ruby on Rails and in the content I'm studying I could not fully understand what attr_accessor is and how it works.     
asked by 13.05.2015 / 14:13
3
answers

Calculate parent and child totals

Friends I have 2 models. Orders have several details. I use cocoon to create the forms. The order model has a total that is the sum of the totals of the child models. What I would like to know is how best to implement a sum in the child and then...
asked by 23.02.2016 / 22:32
1
answer

Refresh DB table when clicking on a li element

I'm developing a mobile application using jqMobile and Ruby. How to update a database table by clicking on an item in a list. My list is generated like this: <ul data-role="listview" data-filter="true" data-filter-theme="a" data-divider-...
asked by 01.06.2014 / 17:42
1
answer

Rails and Webmotors

Anyone with any experience with Rails integration with Webmotors APi? I'm using Gem SAVON to integrate the application with the site API and I'm getting the error:    Savon :: SOAPFault: (soap: Server) Server was unable to process request....
asked by 24.12.2015 / 15:22
2
answers

Heroku deploy with bower-rails

I have gem 'bower-rails' installed in my application but when deploy I have the following error: I added the gem rails_12factor I'm using buildpack : heroku buildpacks:set https://github.com/heroku/heroku-buildpack-ruby...
asked by 22.05.2015 / 16:44
3
answers

How to sort sql queries in the RUBY on Rails model?

I have the following method an ROR application. query_student = "SELECT name, registration, room FROM students WHERE registration = "+ params[:registration]+" AND password = "+params[:password] @student = ActiveRecord::Base.connection.exe...
asked by 19.08.2016 / 19:56
3
answers

Installing ruby with rbenv

I have a question, I installed ruby in ubuntu, but it was installed without rbenv , have a problem install it now, or will it need to remove it first?     
asked by 07.10.2016 / 16:19
1
answer

How do I access elements of an iframe from an external page?

I need to access an id that has inside an external page that I'm rendering in an iframe on my site. Permission error is occurring. How do I resolve this? This is the link on the page: link Fiddle: link Observe my X-Frame-Options....
asked by 20.05.2014 / 17:27
2
answers

What's the difference between declaring a variable with and without "@" in Ruby?

What's the difference between these two possibilities? //com @ @post = Post.find(params[:id]) //sem @ post = Post.find(params[:id]) Usually in controllers it is used with @ , but in functions each of views is usually used with...
asked by 23.04.2014 / 16:46
1
answer

How to model product categories?

I'm about to start developing an e-commerce, but I'm caught up in the issue of modeling, especially in product categories and subcategories. For example. A category can have several sub-categories. Each sub-category may also have sub-sub-categor...
asked by 18.09.2014 / 18:53