New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

radiant-polls-extension

Package Overview
Dependencies
Maintainers
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

radiant-polls-extension

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
3
Created
Source

h1. Polls Extension

This is a significant fork of the original at https://github.com/nuex/radiant-polls-extension ("Web polls for Radiant CMS.")

h2. Differences in this Fork

  • Uses cookies instead of sessions to trace poll responses.
    ** This limits the occurrence of multiple responses from the same respondent, thus skewing poll results ** It also means that we will not automatically expire caches on pages with polls, thus improving overall performance. Instead the server will send both the poll and response data, and client side javascript will read cookies to determine which to display
  • Uses poll_check.js to read cookies, determining if this user has submitted response to this poll yet
  • Switched views from erb to haml
  • Uses radiant-cache_by_page-extension, in order to set shorter cache times on pages with polls

h2. Installation

Using Bundler:

  • add this to your Gemfile

gem "radiant-polls-extension", :git => "https://github.com/avonderluft/radiant-polls-extension.git"

  • %rake radiant:extensions:polls:migrate%
  • %rake radiant:extensions:polls:update%
  • %bundle%

h2. Usage

  • Modify your Radiant Layouts to include:
    ** inside the head tag: ** modify the body tag thus:
  • Create a polls snippet, something like this:
  
    
Poll of the Week


AnswersResults
(%)

If polls are defined with a start date, then the current poll (defined as the poll that has the latest start date that is no later than the current date) can be accessed without the use of the title attribute (i.e., <r:poll>...</r:poll>).

Poll "archives" can also be listed, using pagination via the will_paginate plugin.

<r:polls per_page="10" by="start_date" order="desc"> <r:each:poll>

<r:title />

<r:options:each> </r:options:each>
AnswerResult
<r:title /><r:number_responses /> (<r:percent_responses />%)
</r:each:poll> <r:pages /> </r:polls>

h2. To do

  • the polls (archives) are not working in some instances

h2. Note and Caveats

If you are using the Oracle Enhanced Adapter, you may want to add this to your environment.rb, in the after_initialize block:

By default, OracleEnhancedAdapter typecasts all columns of type DATE to Time or DateTime.

This will force DATE values with hour, min and secs equal to 0 to be typecasted to Date.

ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter.emulate_dates = true

The above can obviously cause problems, therefore this is to be preferred,

since it will typecast to DATE, only columns with “date” in their name (e.g. “creation_date“)

ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter.emulate_dates_by_column_name = true

h2. Acknowledgements

  • Thanks to David Coto (http://github.com/davec) for the many enhancements and specs.
  • The date picker uses Dan Webb's LowPro library and its associated date_selector behavior.

FAQs

Package last updated on 27 Feb 2013

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