Questions tagged as 'ruby-on-rails'

1
answer

How to generate sequential number automatically in Rails?

I am developing a form for registration in a selective process and after the user send the registration data I would like to generate the registration number in the following format: 00012018. I found only one answer to that but it did not work....
asked by 29.05.2018 / 23:32
1
answer

How to display to admin the data specific to each user chosen with rails

In the administrative part that I'm doing, my Admin can see all Subscriptions made by users in a table (this part is working perfectly) My admin controller's code, def index @subs = Subscription.all end Table display code table.table...
asked by 18.04.2018 / 22:34
1
answer

Accordion table in single row

I'm working on a rails app. At the moment I'm messing with the front end. I have a table of how it behaves on large screens. However,whenyoureducethescreen(cellsize)youwouldlikeittostayintheacordionstylewithdropdownonlytheadskinname.Allother...
asked by 26.03.2018 / 21:32
1
answer

What is the difference between form_for and form_tag?

What is the difference between form_for and form_tag in form construction since the end result is apparently the same? In which situation do you choose one or the other?     
asked by 12.12.2017 / 21:45
1
answer

Is it usual to deal with sessions in an Android application?

My question is this: I have a Rails server and I make queries on that server using an Android application. If I were creating a web system, I would use session to manage the permissions of my system. However, as I have the application, I make th...
asked by 28.11.2017 / 20:06
1
answer

Rails 5 validate CPF

Hello, I'm new to RoR. I have a form with field for CPF and I need to validate whether it is valid or not before saving the record. I tried different gems like gem'cpf_cnpj, gem 'brcpfcnpj' and 'validates_cpf_cnpj', but following the readme i...
asked by 26.09.2017 / 23:16
1
answer

How to make a search field with form_tag in rails?

Hello! Good afternoon. I'm an information systems student and I'm doing a small project where I need to put a form to fetch the Product template objects that exist in the database. Product template: class Produto < ApplicationRecord be...
asked by 07.06.2017 / 20:12
1
answer

route problems in ruby on rails

in the routes file Rails.application.routes.draw do root 'pages#home' get 'about', to: 'pages#about' # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end But when I type the URL...
asked by 22.05.2017 / 13:41
1
answer

rails rspec, error in post: create, params require

I'm starting the rspec tests in RubyOnRails and I'm having a problem testing my controller's create: it "creates lançamento" do post :create, params: attributes_for(:lancamento), format: :js, xhr: true expect(Lancamento.count).to eq(1) end...
asked by 11.04.2017 / 16:33
1
answer

Rails - Undefined Method 'client' for 'Book'

Hello, I'm working with ruby on rails and I'm getting the error: 'undefined method', as in the image Theemployeeisworking,andifIputonlythebook.cliente_id,itworks.Followthecodesbelow:view->_livro.html.erb<%=livro.nome%><%=livro.departam...
asked by 18.05.2017 / 08:55