
Security News
Critical Security Vulnerability in React Server Components
React disclosed a CVSS 10.0 RCE in React Server Components and is advising users to upgrade affected packages and frameworks to patched versions now.
alacarte
Advanced tools
h1. Alacarte
Alacarte allows you to setup menus and conditions in your Rails app in a router-like DSL way.
You can easily;
h2. Installation
Alacarte is being developed against Rails 3.0.3. No other versions have been tested.
To install, add Alacarte to your @Gemfile@ and run bundle install:
gem 'alacarte'
After alacarte is installed, you will need to setup a rails initialiser to define your menu.
h3. Initialiser
Add an initialiser file to your rails application; e.g. @config/initialisers/alacarte.rb@ and add the menus in that file using the draw method.
YourApplication::Application.menus.draw do
menu :main do
# menu information goes here...
end
end
h2. How it works
h3. Helper environment
Alacarte is linked to your helper environment, therefore you can call any helper method that is available to your rails app within your menu definition file;
h3. options
You can pass in options to any level of your menu, including the top level. Here are some examples of options;
h3. Menu example
YourApplication::Application.menus.draw do
menu :language do
link :nl, root_path(:locale => :nl), :html => { :class => 'nl' }
link :fr, root_path(:locale => :fr), :html => { :class => 'fr' }
end
menu :main, :group => { :class => 'main' } do
link :home, root_path
link :recent,
link :other_site, 'http://someurl.com'
# ...
# add menu items with runtime methods for path generation
link :my_account, lambda { account_path(current_user) }, :if => lambda{ current_user }
end
end
h3. Render the menu
Render the menu where you like in your view and pass an optional "current element" selector (in this case the current locale);
...
<%= navigation_for(:language, I18n.locale) %>
...
h3. Output example
The output is generated as a ul-li list with anchor elements. If there is an element that can be matched, it will get a class active;
FAQs
Unknown package
We found that alacarte demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
React disclosed a CVSS 10.0 RCE in React Server Components and is advising users to upgrade affected packages and frameworks to patched versions now.

Research
/Security News
We spotted a wave of auto-generated “elf-*” npm packages published every two minutes from new accounts, with simple malware variants and early takedowns underway.

Security News
TypeScript 6.0 will be the last JavaScript-based major release, as the project shifts to the TypeScript 7 native toolchain with major build speedups.