{"id":21201653,"url":"https://github.com/oleander/flyer-rb","last_synced_at":"2025-03-14T22:25:57.334Z","repository":{"id":27043619,"uuid":"30508779","full_name":"oleander/flyer-rb","owner":"oleander","description":"Display user notifications in Rails programmatically","archived":false,"fork":false,"pushed_at":"2015-02-09T14:19:24.000Z","size":180,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-21T15:04:43.617Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oleander.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-08T22:43:37.000Z","updated_at":"2015-02-09T14:19:11.000Z","dependencies_parsed_at":"2022-08-31T16:44:47.529Z","dependency_job_id":null,"html_url":"https://github.com/oleander/flyer-rb","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2Fflyer-rb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2Fflyer-rb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2Fflyer-rb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2Fflyer-rb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oleander","download_url":"https://codeload.github.com/oleander/flyer-rb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243654399,"owners_count":20325892,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T20:10:22.298Z","updated_at":"2025-03-14T22:25:57.307Z","avatar_url":"https://github.com/oleander.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flyer\n\nDisplay user notifications in Rails programmatically.\n\n## Install\n\n`gem install flyer`\n\n## Usage\n\n``` ruby\n# config/initializers/flyer.rb\n# Use one init block for each notification\nFlyer::Notification.init do |config|\n  # Unique id. Used to uniquely identify a notification.\n  config.id = \"new-user\"\n\n  # Message to be passed to view. Is evaluated in the view context.\n  config.message { \"Your nickname is #{current_user.nickname}\" + icon(\"flash\") }\n\n  # Optional. Path to be pssed to view. Is evaluated in the controller context.\n  config.path { root_path }\n\n  # Optional. Only display notification if this blocks evaluates to true\n  # The block is evaluated in the controller context.\n  config.on { current_user.admin? and not first_visit? }\n\n  # Optional. Number of times to display the notification \n  # for each user. Default is 1.\n  config.limit = 1\n\n  # Optional. When should the notification be visible?\n  config.valid = { from: \"2015-04-01\", to: \"2016-04-01\" }\n\n  # Optional. Arbitrary data to be passed to view. \n  config.params = { timeout: 10 }\nend\n\n# Global configuration\nFlyer.configure do |config|\n  # Only display one notification at the time\n  config.max_notifications = 1\nend\n```\n\n``` erb\n-- app/views/_notifications.html.erb (any view)\n\u003c% notifications.each do |notification| %\u003e\n  \u003c%= notification.path %\u003e\n  \u003c%= notification.message %\u003e\n  \u003c%= notification.params %\u003e\n\u003c% end %\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleander%2Fflyer-rb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foleander%2Fflyer-rb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleander%2Fflyer-rb/lists"}