Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
72 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,8 +1,7 @@ | |||
class GoogleFormsController < InheritedResources::Base | class GoogleFormsController < InheritedResources::Base | ||
def show | def create | ||
show! do |format| | create! do |format| | ||
@view_form_url = "/#{@google_form.slug}" | format.html { redirect_to google_forms_path } | ||
format.html | |||
end | end | ||
end | end | ||
end | end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,26 @@ | |||
%h2 Our forms | |||
|
|||
%p | |||
= link_to "Add Google Form", new_google_form_path | |||
|
|||
.ss-grid | |||
%table | |||
%thead | |||
%tr | |||
%th Slug | |||
%th Title | |||
%th Original Form | |||
%th Actions | |||
%tbody | |||
- unless @google_forms.blank? | |||
- for form in @google_forms | |||
%tr | |||
%td= link_to form.slug, "/#{form.slug}" | |||
%td= form.title | |||
%td= link_to form.formkey, form.google_form_url | |||
%td | |||
= link_to "Live", "/#{form.slug}" | |||
= link_to "Edit", edit_google_form_path(form) | |||
- else | |||
%tr | |||
%td{:colspan => 4} No forms yet. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,14 @@ | |||
class AddTitleToGoogleForms < ActiveRecord::Migration | |||
def self.up | |||
add_column :google_forms, :title, :string | |||
|
|||
GoogleForm.all.each do |form| | |||
form.title = form.slug | |||
form.save | |||
end | |||
end | |||
|
|||
def self.down | |||
remove_column :google_forms, :title | |||
end | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1 +1 @@ | |||
|
features/google_forms.feature:6 |