{"id":22511119,"url":"https://github.com/rjayroach/mcp_common","last_synced_at":"2025-06-14T07:10:14.952Z","repository":{"id":11876807,"uuid":"14437610","full_name":"rjayroach/mcp_common","owner":"rjayroach","description":"Common Support Functions for Rails Apps","archived":false,"fork":false,"pushed_at":"2014-06-17T15:21:10.000Z","size":488,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-02T02:28:36.212Z","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/rjayroach.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-15T23:16:24.000Z","updated_at":"2014-06-17T15:21:10.000Z","dependencies_parsed_at":"2022-08-28T20:21:44.957Z","dependency_job_id":null,"html_url":"https://github.com/rjayroach/mcp_common","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjayroach%2Fmcp_common","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjayroach%2Fmcp_common/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjayroach%2Fmcp_common/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjayroach%2Fmcp_common/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rjayroach","download_url":"https://codeload.github.com/rjayroach/mcp_common/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245949553,"owners_count":20698916,"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-12-07T02:09:02.332Z","updated_at":"2025-03-28T00:40:33.764Z","avatar_url":"https://github.com/rjayroach.png","language":"Ruby","readme":"# McpCommon\n\n## Building this Gem\n\n- had to copy over bootstrap PNGs for icons to the assets/images dir of this gem to get them to appear\n\n## Using in an Application\n\nFor the purpose of this document, an \"application\" means a full rails application OR an engine test application found in spec/dummy, test/dummy, etc.\n\n## Gems\n\nCommon functionality is provided by many gems included in McpCommon, however, these gems also need to be included in any application.\n The following gems are required to be included in the application's Gemfile:\n\n* bootstrap-saas\n\n## Configuration\n\n### Javascripts:\n\nThe application needs to provide jquery, jquery-ui and jquery_ujs (the default)\nAny other engines in the application need to NOT import these libraries\nCommon will include all other gem's javascripts, including dataTables, chosen, etc.\n\n\n## Features\n\n\n### Mcp Initializer\n\nIn config/initalizers is mcp.rb which parses Rails in-memory list of installed 'mcp' engines for the application and installs creates a static variable containing a reference to each 'mcp' engine\n\nThe initializer recognizes 'mcp' engines by checking if the respond_to? :mcp which they will do when they have that method defined in lib/\u003cengine name\u003e.rb\n\n\n### API Controller\n\nincludes two files: lib/mcp_common/api_constraints.rb and controllers/mcp_common/api/api_controller.rb\nthese files are loaded on startup from lib/mcp_common.rb\n\n\n### Application Layout, Menus and Notification\n\nThe main app's ApplicationController should delegate the layout to McpCommon:\n\nlayout \"layouts/mcp_common/application\"\n\nMcpCommon's layout:\n- creates a layout with CSS classes suitable for Twitter Bootstrap\n- will load JS and CSS from all loaded Mcp Engines on each request\n- renders each 'mcp' engine's _navigation.html.erb\n- renders _messages.html.erb which displays notifications to user so the form doesn't have to\n\n\n### MultiTab\n\nRenders one or more Twitter Bootstrap horizontal tab(s) and corresponding \u003cdiv\u003e for rendering a dataTable as content onto an html \u003ctable\u003e\n\nThe feature includes ERB partials and a CoffeeScript file\n\nThe partials responsible for rendering are: multi_tab/_layout, multi_tab/_tabs and multi_tab/tables\nThe JS is multi_tab.js.coffee\n\nAn example can be found in McpPbx engine in app/views/mcp_pbx/cdrs/index.html.erb\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frjayroach%2Fmcp_common","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frjayroach%2Fmcp_common","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frjayroach%2Fmcp_common/lists"}