diff options
| author | mo k <mo@mokhan.ca> | 2013-02-20 20:51:04 -0700 |
|---|---|---|
| committer | mo k <mo@mokhan.ca> | 2013-02-20 20:51:04 -0700 |
| commit | d754e1867f7a9852dcfd4fa5c0f4bc4eb07cea81 (patch) | |
| tree | 567a6844fd3c2e0e56bf28bbd1fff55f14666867 | |
| parent | a97c035a584f2d355ce54185481db530a9662c4a (diff) | |
make sure proper tutorial_tags element is passed to the controller.
| -rw-r--r-- | app/models/tutorial.rb | 1 | ||||
| -rw-r--r-- | app/views/tutorials/_form.html.erb | 3 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/tutorial.rb b/app/models/tutorial.rb index a74f40e0..311ccc64 100644 --- a/app/models/tutorial.rb +++ b/app/models/tutorial.rb @@ -1,5 +1,6 @@ class Tutorial < ActiveRecord::Base attr_accessible :description, :heading, :url, :image_url, :user_id, :author, :author_url + validates :url, :presence => true belongs_to :user acts_as_taggable diff --git a/app/views/tutorials/_form.html.erb b/app/views/tutorials/_form.html.erb index a948f68d..bc276764 100644 --- a/app/views/tutorials/_form.html.erb +++ b/app/views/tutorials/_form.html.erb @@ -20,7 +20,7 @@ $(function(){ </div> <div class="control-group"> <label for="tags" class="control-label">Tags</label> - <input type="text" id="tags" value="" class="input-xxlarge" autocomplete="off" /> + <input type="text" id="tags" name="tutorial_tags" value="" class="input-xxlarge" autocomplete="off" /> </div> <div class="form-actions"> <%= f.hidden_field :heading, :class => "input-xlarge, tutorial-heading" %> @@ -28,7 +28,6 @@ $(function(){ <%= f.hidden_field :author_url, :class => "input-xlarge, tutorial-author-url" %> <%= f.hidden_field :description, :class => "input-xlarge, tutorial-description" %> <%= f.hidden_field :image_url %> - <input type="hidden" name="tutorial_tags" id="hidden_tags" /> <button type="submit" class="btn btn-primary">Save changes</button> <a href="<%= url_for tutorials_url %>" class="btn">Cancel</a> </div> |
