From 96d49bf04ce77c975fe500f4d961e4a1ffed4c26 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 30 Dec 2012 14:43:00 +0200 Subject: Use sdoc to generate application code documentation --- doc/code/classes/SnippetsController.html | 611 +++++++++++++++++++++++++++++++ 1 file changed, 611 insertions(+) create mode 100644 doc/code/classes/SnippetsController.html (limited to 'doc/code/classes/SnippetsController.html') diff --git a/doc/code/classes/SnippetsController.html b/doc/code/classes/SnippetsController.html new file mode 100644 index 00000000000..fd7e0fe6d19 --- /dev/null +++ b/doc/code/classes/SnippetsController.html @@ -0,0 +1,611 @@ + + + + + SnippetsController + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + +
Methods
+
+ +
A
+
+ +
+ +
C
+
+ +
+ +
D
+
+ +
+ +
E
+
+
    + + +
  • + edit +
  • + +
+
+ +
I
+
+ +
+ +
N
+
+
    + + +
  • + new +
  • + +
+
+ +
R
+
+
    + + +
  • + raw +
  • + +
+
+ +
S
+
+ +
+ +
U
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + +
Instance Public methods
+ +
+
+ + create() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/snippets_controller.rb, line 26
+def create
+  @snippet = @project.snippets.new(params[:snippet])
+  @snippet.author = current_user
+  @snippet.save
+
+  if @snippet.valid?
+    redirect_to [@project, @snippet]
+  else
+    respond_with(@snippet)
+  end
+end
+
+
+ +
+ +
+
+ + destroy() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/snippets_controller.rb, line 55
+def destroy
+  return access_denied! unless can?(current_user, :admin_snippet, @snippet)
+
+  @snippet.destroy
+
+  redirect_to project_snippets_path(@project)
+end
+
+
+ +
+ +
+
+ + edit() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/snippets_controller.rb, line 38
+def edit
+end
+
+
+ +
+ +
+
+ + index() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/snippets_controller.rb, line 18
+def index
+  @snippets = @project.snippets.fresh
+end
+
+
+ +
+ +
+
+ + new() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/snippets_controller.rb, line 22
+def new
+  @snippet = @project.snippets.new
+end
+
+
+ +
+ +
+
+ + raw() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/snippets_controller.rb, line 63
+def raw
+  send_data(
+    @snippet.content,
+    type: "text/plain",
+    disposition: 'inline',
+    filename: @snippet.file_name
+  )
+end
+
+
+ +
+ +
+
+ + show() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/snippets_controller.rb, line 51
+def show
+  @note = @project.notes.new(noteable: @snippet)
+end
+
+
+ +
+ +
+
+ + update() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/snippets_controller.rb, line 41
+def update
+  @snippet.update_attributes(params[:snippet])
+
+  if @snippet.valid?
+    redirect_to [@project, @snippet]
+  else
+    respond_with(@snippet)
+  end
+end
+
+
+ +
+ +
Instance Protected methods
+ +
+
+ + authorize_admin_snippet!() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/snippets_controller.rb, line 82
+def authorize_admin_snippet!
+  return render_404 unless can?(current_user, :admin_snippet, @snippet)
+end
+
+
+ +
+ +
+
+ + authorize_modify_snippet!() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/snippets_controller.rb, line 78
+def authorize_modify_snippet!
+  return render_404 unless can?(current_user, :modify_snippet, @snippet)
+end
+
+
+ +
+ +
+
+ + snippet() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/controllers/snippets_controller.rb, line 74
+def snippet
+  @snippet ||= @project.snippets.find(params[:id])
+end
+
+
+ +
+
+ +
+ + \ No newline at end of file -- cgit v1.2.1