Harris Mariano

Joined

2,270 Experience
0 Lessons Completed
3 Questions Solved

Activity

Posted in How to validate model attribute

Hello everyone, question.

I have the following code:

class Country < ActiveRecord::Base
has_many :cities, dependent: :destroy
accepts_nested_attributes_for :cities
end

class City < ActiveRecord::Base
belongs_to :country
has_many :islands, dependent: :destroy
end

class Island < ActiveRecord::Base
belongs_to :city
validates :name , uniqueness: { scope: :city_id }
end

How to make island name unique within the city and within the country. Thank you in advance.

Hi everyone,

I am new to rails and would like to ask how to create pdf thumbnails on each pages and/or convert each pages to an image and generate a thumbnail. Thank you.

Hi everyone,

I am new to rails and would like to ask how to create pdf thumbnails on each pages and/or convert each pages to an image and generate a thumbnail. Thank you.

Hi everyone,

I am new to rails and would like to ask how to create pdf thumbnails on each pages and/or convert each pages to an image and generate a thumbnail. Thank you.