Rumamge.Phoenix v1.0.0 Rummage.Phoenix
Rummage.Phoenix
is a support framework for Phoenix
that can be used to manipulate
Phoenix
collections and Ecto
models with Search, Sort and Paginate operations.
It accomplishes the above operations by using Rummage.Ecto
, to paginate Ecto
queries and adds Phoenix and HTML support to views and controllers.
Each operation: Search, Sort and Paginate have their hooks defined in Rummage.Ecto
and is configurable.
The best part about rummage is that all the three operations: Search
, Sort
and
Paginate
integrate seamlessly and can be configured separately. To check out their
seamless integration, please check the information below.
If you want to check a sample application that uses Rummage, please check this link.
Summary
Functions
config
returns the value associated with the given key
and returns default
if
the value is nil
:default_helpers
can also be set at run time
in the config.exs
file
:default_per_page
can also be set at run time
in the config.exs
file
resolve_system_config
returns a system variable set up or returns the
specified default value
Functions
config
returns the value associated with the given key
and returns default
if
the value is nil
.
Examples
Returns value corresponding to config or returns the default value:
iex> alias Rummage.Phoenix
iex> Phoenix.config(:x, "default")
"default"
:default_helpers
can also be set at run time
in the config.exs
file
Examples
Returns default Repo
set in the config
(2 in
rummage_ecto`’s test env):
iex> alias Rummage.Phoenix
iex> Phoenix.default_helpers
Rummage.Phoenix.Router.Helpers
:default_per_page
can also be set at run time
in the config.exs
file
Examples
Returns default Repo
set in the config
(2 in
rummage_ecto`’s test env):
iex> alias Rummage.Phoenix
iex> Phoenix.default_per_page
2
resolve_system_config
returns a system variable set up or returns the
specified default value
Examples
Returns value corresponding to a system variable config or returns the default value:
iex> alias Rummage.Phoenix
iex> Phoenix.resolve_system_config({:system, "some random config"}, "default")
"default"