![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
A little gem for supporting back history in your applicaton. It uses a simple request-parameter 'back' with every back-path separated with a '|'.
Add this line to your application's Gemfile:
gem 'backable'
And then execute:
$ bundle
To use this plugin. You can build up the backable stack via the controller method backable_push
.
To pass the history to the next page remember to use backable_url_for
instead of url_for
.
You can configure the Backable.fallback_url, which is called when nothing is on the stack.
Backable.fallback_url
class FooBarsController < ApplicationController
def index
backable_push([:foo_bars]) #< push the back-url. This can be a string url
..
end
def update
@foo_bar = FooBar.find(params[:id])
if @foo_bar.update(params[:foo_bar])
redirect_to backable_back_path, notice: "Data is saved"
end
end
end
Available controller methods:
Method | description |
---|---|
backable_push | Pushes the given url to the stack |
backable_url_for | url_for replacement which includes the 'back' parameter |
backable_back_path | Returns the path to the previous page |
backable_param | Returns the back parameter for the given stack (internal method) |
backable_history | Returns and array of the previous paths |
backable_future | Returns the future paths (pushed on the stack in this request) |
To make this all work you need to replace all links in your application (link_to) to backable_link_to
<%= backable_link_to( [:edit, @item]) %>
To use this with buttons etc.. there's also the backable_url_for
method
You can simple add a back-button via backable_link_to_back
. This link goes back to previous page in the stack.
<%= backable_link_to_back %>
To remember your back-stack in forms you should use the backable_form_item
<%= backable_form_item %>
Available view-helper methods:
Method | description |
---|---|
backable_url_for | url_for replacement which includes the 'back' parameter |
backable_back_path | Returns the path to the previous page |
backable_form_item | A hidden form element that includes the 'back' parameter |
backable_link_to | link_to replacement which includes the 'back' parameter |
backable_link_to_back | A link_to call to the previous page (including the text t(backable.back)) |
backable_history | Returns and array of the previous paths |
backable_future | Returns the future paths (pushed on the stack in this request) |
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that backable 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.