ruby tag

542 questions


2 answers
86 views
0
Find_by can be found, but find can't be found.

First, check out the debugs for pry.[11]pry(#<BookController>)>a=Sentence.find_bybook_id:10 CACHE(0.0ms) SELECT sentences.* FROM sentences WHERE sentences. book_id =?LIMIT1 [[[...

2 years ago

1 answers
122 views
0
What are the errors that occur when deploying the Rails app to Heroku?

When you deploy the Rails app you are currently developing to Heroku, $git push heroku masterThe following error occurs:remote:----->Ruby app detectedremote —----- > Compiling Ruby/Railsremote :...


1 answers
136 views
0
I am creating an app for Rails.How do I sort columns by minimum → maximum in ActiveRecord?

I am currently creating an app for Rails.Below, I would like to sort by sign column minimum value → maximum value in the costs table, what should I do?The reason why I wanted to sort by sign column mi...


1 answers
70 views
0
Data-toggle Does Not Work with Rails accept_nested_attributes_for

Ruby on Rails using nested_form, cocoon, etc. You are creating a one-to-many relationship model using accepts_nested_attributes_for.Use link_to_add_association on the one-to-many form to If you dynami...

2 years ago

1 answers
72 views
0
Understanding the View Table Display of Rails Table Results

I'm a beginner.If you want to display the results in view from the results obtained from the model, If the contents of the model become variable (the process of changing the model with connection each...


1 answers
86 views
0
How to implement attr that takes time to generate in ruby

There are currently classes like this.class Hoge attr_accessor:fuga, :piyo def initialize data_create end def data_create data = various actions {...} # substitute for instance variable @fuga=data[:a]...

2 years ago

1 answers
64 views
0
I want the rails form to display errors by column.

All errors are currently displayed in one place using errors.full_messages.each.I want this to appear in the display just above each column with an error, but I don't know how to do it.Could you pleas...

2 years ago

2 answers
69 views
0
extracting the same part from multiple strings

text_1='hoge'text_2 = 'hoge kakikakeko'text_3 = 'hoge'Expected value = > 'hoge'text_1='hoge'text_2 = 'hoge Ayeo Kakikakeko'text_3='hoge'Expected value = > 'hoge'Only the 前方forward match 」 I'd li...

2 years ago

1 answers
79 views
0
I want to test the Ransack part in Rails Rspec, but I get an error saying undefined method `[]'for nil: NilClass

This is a question about Rspec.I'm writing the code for the Rspec test to see if Ransack is working properly, but in the simulation section of the search execution, NoMethodError:undefined method `[]'...

2 years ago

1 answers
67 views
0
Using Ruby to Create Client Software to Synchronize the Rails Server Database with Local

If you have any advice on how to create a client application with a database using Ruby, could you please give me some advice?Rails server is present.This has already been created.We are planning to c...

2 years ago
« - 9 - »

© 2024 OneMinuteCode. All rights reserved.