I am working on a new application with Elixir, Dish_out. I have run into a few minor problems that I am trying to figure out.
My text box for the summary only allows for a certain amount of characters. How can I increase the number of characters inside the text box and also the text box itself? Here is my attempt at this
schema "delish_foods" do
field :date, :integer
field :ingredients, :string
field :summary, :string
field :title, :string
timestamps()
end
alter table(:delish_foods) do
modify :content, :text
end
end
is there a way to format the date input to add / or - to make it look cleaner rather than just numbers? perhaps a time/date library.
I upload the code files on gitHub it is free to view
in your first bullet point you said if I am restricting anything
defmodule DishOut.Foods.Food do
use Ecto.Schema
import Ecto.Changeset
schema "delish_foods" do
field :date, :integer
field :ingredients, :string
field :summary, :string
field :title, :string
timestamps()
end
# alter table(:delish_foods) do
# modify :content, :text
# end
# The alter table I am increasing my char count to string over 255 for summary
@doc false
def changeset(food, attrs) do
food
|> cast(attrs, [:title, :ingredients, :summary, :date])
|> validate_required([:title, :ingredients, :summary, :date])
end
end
As you can see My changeset is not redistricting anything. Should I then add max: 250?
I looked at the Hex docs, could I take the same steps as what he did here to change :date type to :date this way I could use that as a format for writing dates, rather than just integers?