Kayıtlar

ruby on rails etiketine sahip yayınlar gösteriliyor

Use href in HTML instead of link_to [Rails]

If you want to use href in HTML instead of link to. It's equivalent link_to in Rails. And if you want to use method you must use data-method in a tag. Reference:  http://blog.umutbey.com/en/equivalent-link_to-in-html

Object appear problem in active admin form [Ruby on Rails]

If you use active admin and if you use migration with references, in admin panel you can see object number on edit or new form. Let's say we have a company and a user table, and we have a reference to user_id in company. I assume that "belongs_to" and "has_many" added. You write in terminal "rails generate migration AddUserReferecesToCompanies user:references" and then enter commandline "rails db:migrate". Now you add this line in app/admin/companies.rb (because we are the model we initially assumed. Also you must be generated activeadmin resource like "rails g active_admin:resource company".)