
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
radiant-forms-extension
Advanced tools
Using this on master so that we can test the gem, this isn't recommended in production
This extension allows a developer to create forms which can take on multiple tasks
Using forms 'DRY's up the process of creating and reusing forms across a site (well I think so at least).
The New way:
gem install radiant-forms-extension
# add the following line to your config/environment.rb: config.gem 'radiant-forms-extension', :lib => false
rake radiant:extensions:forms:update
rake radiant:extensions:forms:migrate
The old way:
git clone git://github.com/squaretalent/radiant-forms-extension vendor/extensions/forms
rake radiant:extensions:forms:update
rake radiant:extensions:forms:migrate
A new tab will be present under design, a form has the following properties
Include the form in a page using a radius tag <r:form name="form_title" />
<ol>
<li>
<r:label for='contact[name]'>
<span class='title'>Your Name</span>
<r:text name='contact[name]' />
</r:label>
</li>
<li>
<r:label for='contact[email]'>
<span class='title'>Your Email</span>
<r:text name='contact[email]' />
</r:label>
</li>
<li>
<r:submit value='Send My Name' />
</li>
</ol>
<h2>Contact from <r:get name='contact[name]' /></h2>
<p>You can get back to them on <r:get name='contact[email]' /></p>
<p>Cheers, <br /> <strong>Cool Mailer</strong></p>
assuming you have forms_mail installed as well
cool_mailer:
extension: mail
field:
from: contact[email]
recipients: info@company.com
<html>
<head>Some Terribly Designed Radiant Page</head>
<body>
<r:forms:response>
<h2>Thank you for contacting us <r:get name='contact[name]' /></h2>
<!-- We need to clear the response, sort of like flash data -->
<r:clear />
</r:forms:response>
</body>
</html>
Delete the following line in config/environment.rb
config.frameworks -= [ :action_mailer ]
or just remove the :action_mailer references
config.frameworks -= []
Define your mailing variables
hardcoded
cool_mailer:
extension: mail
from: email@email.com
to: email@email.com
reply_to: email@email.com
subject: subject text
variable
cool_mailer:
extension: mail
field:
from: person[email]
to: person[email]
subject: contact[subject]
reply_to: person[email]
Of course you are probably using sendgrid to make sending emails easy, but if you're using SMTP create the following to /config/initializers/form_mail.rb
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.smtp_settings = {
:enable_starttls_auto => true,
:address => "smtp.gmail.com",
:port => "587",
:domain => "smtp.gmail.com",
:authentication => :plain,
:user_name => "username@gmail.com",
:password => "password"
}
A showcase of how to use addons, allows you to send emails directly from the page
class FormBlah
include Forms::Models::Extension # Sorts out initialization giving you
# def initialize(form, page)
# @form = form
# @page = page
#
# @data = @page.data
# @config = @form.config[self.class.to_s.downcase.gsub('form', '').to_sym].symbolize_keys # @form.config[:blah]
def create
# return = {
# :hash => 'these details will be returned to the result page namespaced under blah'
# }
end
end
Any form configured with a block containing a blah extension key will know to call this models create method
cool_mailer:
extension: blah
key: value
another: value
I'm going to let you sort that out, you have the create action with input and output
from here you can decide how your form addon is going to behave.
unless ENV["RAILS_ENV"] == "production"
config.gem 'rspec', :version => '1.3.0'
config.gem 'rspec-rails', :version => '1.3.2'
config.gem 'cucumber', :verison => '0.8.5'
config.gem 'cucumber-rails', :version => '0.3.2'
config.gem 'database_cleaner', :version => '0.4.3'
config.gem 'ruby-debug', :version => '0.10.3'
config.gem 'webrat', :version => '0.7.1'
config.gem 'rr', :version => '0.10.11'
end
FAQs
Unknown package
We found that radiant-forms-extension 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
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.