Fix link_to_function in contesters

Fix params for comment and message
Fix tinymce errors
This commit is contained in:
Ari Timonen 2020-03-18 21:41:54 +02:00
parent c97a47ffda
commit 5d4132ccbf
7 changed files with 259 additions and 261 deletions

View file

@ -16,7 +16,7 @@ class CommentsController < ApplicationController
end
def create
@comment = Comment.new Comment.params(parmas, cuser)
@comment = Comment.new(Comment.params(params, cuser))
@comment.user = cuser
raise AccessError unless @comment.can_create? cuser

View file

@ -50,7 +50,7 @@ class ContestersController < ApplicationController
if @contester.update_attributes(Contester.params(params, cuser))
flash[:notice] = t(:contests_contester_update)
redirect_to @contester.contest
redirect_to_back
else
render :edit
end

View file

@ -67,6 +67,6 @@ class Comment < ActiveRecord::Base
end
def self.params params, cuser
params.require(:ban).permit(:text, :user_id, :commentable_type, :commentable_id)
params.require(:comment).permit(:text, :user_id, :commentable_type, :commentable_id)
end
end

View file

@ -128,6 +128,6 @@ class Contester < ActiveRecord::Base
end
def self.params params, cuser
params.require(:contester).permit(:team_id, :score, :win, :lowss, :draw, :contest_id, :active, :extra)
params.require(:contester).permit(:team_id, :score, :win, :lowss, :draw, :contest_id, :active, :extra, :user)
end
end

View file

@ -98,6 +98,6 @@ class Message < ActiveRecord::Base
def self.params(params, cuser)
# FIXME: check this
params.require(:message).permit(:recipient_type, :sender_type, :title, :text, :recipient_id, :sender_id)
params.require(:message).permit(:recipient_type, :sender_type, :title, :text, :recipient_id, :sender_id, :sender_raw)
end
end

View file

@ -177,7 +177,7 @@
<%= form_for contester do |c| %>
<%= c.hidden_field :active, { value: 1 } %>
<%= link_to icon('pencil'), edit_contester_path(contester) %>
<%= link_to_function icon('rotate-left'), "$('#edit_contester_#{contester.id}').submit()" %>
<%= link_to icon('rotate-left'), "#form_submit" %>
<% end %>
<% end %>
</td>

View file

@ -11,8 +11,6 @@ articles:
# mode: "textareas",
#theme: "modern"
plugins:
- inlinepopups
- contextmenu
- nonbreaking
- template
# theme_advanced_buttons1: "bold,italic,blockquote,|,bullist,numlist,|,formatselect,|,link,unlink,image,|,cleanup,code",