Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rails_liff

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rails_liff

  • 0.7.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

RailsLiff

RailsLiff make LIFF easy to use.

Feature

  • register LIFF once and reuse to your all path.
  • liff_submit event: a hook when LIFF form submit, with form data in js object format.
  • liff_send_text_message: quick send message and close LIFF.

Installation

gem 'rails_liff'

login to line developers, and create 3 LIFF for 3 different size.

  • for compact

    • name: Compact
    • size: Compact
    • Endpoint URL: https://yourwebsite/liff
  • for tall

  • for full

and then copy the result to enviroment parameters:

LIFF_COMPACT=line://app/for_compact_liff_id
LIFF_TALL=line://app/for_tall_liff_id
LIFF_FULL=line://app/for_full_liff_id

Usage

Implement LIFF View

RailsLiff using view format .liff, so you can reuse exists controller and model, you can create a LIFF form by only adding a new view file.

Suppose you have a resource todos, you want to create a liff form for todos/new, so you create a file app/views/todos/new.liff.erb, the content is as follows:

<% content_for :title, "new todo" %>

<%= render "todos/form.html", todo: @todo %>

<%= link_to "test", liff_path(path: '/todos/new') %>

You can test the form at localhost:3000/todos/new.liff

You can change any path to liff by liff_path method.

for example:

liff_path(path: '/todos/new')

You can choice the liff size by liff_size parameter. the default value of liff_size is compact.

liff_path(path: '/todos/new', liff_size: :compact)
liff_path(path: '/todos/new', liff_size: :tall)
liff_path(path: '/todos/new', liff_size: :full)

liff_path method add format :liff automatically.

Author

create by etrex

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 12 Mar 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc