Questions tagged [Ruby on Rails] (2693)

1
answer

Rails bigint not working?

Rails 5.2.3 old migration:class CreateTmpUsers < ActiveRecord::Migration[5.2] def change create_table(:tmp_users) do |t| t.integer :external_id ... end add_index ... end end the last migration:class MigrateToRails52 < ActiveRecord::Migration[5.2] def up change_column :tmp_users, :external_id, :bigint ... end sch...
osbaldo asked March 30th 20 at 00:57
1
answer

How to remove and re-create migration rails?

I had to remove all migration files, because of confusion, how can I create a new to migrate a dB on heroku to localhost c
Cheyenne asked March 30th 20 at 00:43
1
answer

How to insert ruby in js?

I want when clicking on the button opens the block with all the comments how to insert this code in js to make it work?<h1>All comments</h1> <% @task.comments.each do |comment| %> <p><strong><%= comment.name %></strong> : <%= comment.description %> </p> <% end %>
martina.Cremin asked March 30th 20 at 00:27
0
answer

Combining two different Rails project?

Good day! Learn Ruby on Rails, Written lessons, a Blog and forum As two completely different project, now I want to combine these Two projects into One for the Blog and the Forum was linked. That is have one account in the blog and the forum, for example in Google. Was made as a single site. for example site.co/the blog an...
Fiona.Bradtke asked March 29th 20 at 23:53
1
answer

How to display values from db in a rails select tag?

I'm trying to select all the names from the table user, which then fall to the table as task performers here is the code selekta <%= f.select :assignee , options_for_select(User.all, :name) %> But the values I get hashed alt="image"/> how to fix it?
cedrick asked March 29th 20 at 23:53
2
answers

As using Devise, Cancancan, Rolify to give individual users the ability to work with objects?

Confused. One role: admin. You can add more. The three users. One user - admin. The other two with no roles. Also there are Books. I want that the admin could do anything with books and with users. But user 1 could only read books 1 and user-2 could only read and edit the book-2. How to do it? I think only the most stupid ...
pamela.Hirt asked March 29th 20 at 23:47
1
answer

How to fix the error ActionController::RoutingError (No route matches [GET] "/json")?

Started GET "/json" for ::1 at 2019-09-14 19:07:53 +0300 ActionController::RoutingError (No route matches [GET] "/json"): actionpack (6.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:36:in `call' web-console (4.0.1) lib/web_console/middleware.rb:132:in `call_app' web-console (4.0.1) lib/web_console/middleware.rb:...
kian asked March 29th 20 at 23:38
0
answer

How in Rails to do a redirect at the end /?

In application.rb added:config.action_controller.default_url_options = { trailing_slash: true } Now all URLs are generated with the end in / But how to do redirect to url ending in / , if it come?
Providenci asked March 29th 20 at 23:32
2
answers

Error when deploying rails application on aws?

Good day! I am new to rails. The application uses a gem browserify-rails. As browserify installed in the application root (npm install -g browserify). Try to deplot on aws (cap production deploy), after some time crashes with the error: DEBUG [da7afbac] rake aborted! DEBUG [da7afbac] BrowserifyRails::BrowserifyError: Unable...
dejah_Hermiston asked March 29th 20 at 23:24
1
answer

What is the error when installing Rails?

What went wrong and how to fix it?$ gem i rails Temporarily enhancing PATH for MSYS/MINGW... Building native extensions. This could take a while... ERROR: Error installing rails: ERROR: Failed to build gem native extension. current directory: D:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/websocket-driver-0.7.1/ext/websocket-dri...
Gus80 asked March 29th 20 at 23:18