Rumamge.Phoenix v2.0.0 Rummage.Phoenix View Source

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.

Link to this section 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_max_page_links 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

:default_theme 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

Link to this section Functions

Link to this function

config(key, default \\ nil)

View Source

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 helpers set in the config (Rummage.Phoenix.Router.Helpers in Rummage.Phoenix's test env):

iex> alias Rummage.Phoenix
iex> Phoenix.default_helpers
Rummage.Phoenix.Router.Helpers
Link to this function

default_max_page_links()

View Source

:default_max_page_links can also be set at run time in the config.exs file

Examples

Returns default default_max_page_links set in the config (5 in Rummage.Phoenix's test env):

iex> alias Rummage.Phoenix
iex> Phoenix.default_max_page_links
5

:default_per_page can also be set at run time in the config.exs file

Examples

Returns default per_page set in the config (2 in Rummage.Phoenix's test env):

iex> alias Rummage.Phoenix
iex> Phoenix.default_per_page
2

:default_theme can also be set at run time in the config.exs file

Examples

Returns default theme set in the config (:bootstrap in Rummage.Phoenix's test env):

iex> alias Rummage.Phoenix
iex> Phoenix.default_theme
:bootstrap
Link to this function

resolve_system_config(arg, default)

View Source

Specs

resolve_system_config(Tuple.t(), term()) :: {term()}

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"