rake aborted!
Java::JavaLang::NullPointerException:
(in /home/sivamanikandan/projects/code/current/empwiz/app/assets/stylesheets/components/common/forms/elements/bootstrap-datepicker/assets/custom/less/bootstrap-datepicker.less)
org.jruby.java.proxies.ArrayJavaProxy.to_a(org/jruby/java/proxies/ArrayJavaProxy.java:145)
RUBY.method_missing(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/therubyrhino-2.0.4/lib/rhino/rhino_ext.rb:115)
org.mozilla.javascript.optimizer.OptRuntime.callName(org/mozilla/javascript/optimizer/OptRuntime.java:63)
org.mozilla.javascript.gen._home_sivamanikandan__rvm_gems_jruby_1_7_13_empwiz_gems_less_2_5_1_lib_less_js_lib_less_parser_js_2._c_anonymous_31(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/less-2.5.1/lib/less/js/lib/less/parser.js:669)
org.mozilla.javascript.gen._home_sivamanikandan__rvm_gems_jruby_1_7_13_empwiz_gems_less_2_5_1_lib_less_js_lib_less_parser_js_2._c_anonymous_31(org/mozilla/javascript/gen//home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/less-2.5.1/lib/less/js/lib/less/parser.js:669)
org.mozilla.javascript.optimizer.OptRuntime.call1(org/mozilla/javascript/optimizer/OptRuntime.java:32)
org.mozilla.javascript.gen._home_sivamanikandan__rvm_gems_jruby_1_7_13_empwiz_gems_less_2_5_1_lib_less_js_lib_less_import_visitor_js_36._c_anonymous_4(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/less-2.5.1/lib/less/js/lib/less/import-visitor.js:25)
org.mozilla.javascript.gen._home_sivamanikandan__rvm_gems_jruby_1_7_13_empwiz_gems_less_2_5_1_lib_less_js_lib_less_import_visitor_js_36._c_anonymous_4(org/mozilla/javascript/gen//home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/less-2.5.1/lib/less/js/lib/less/import-visitor.js:25)
org.mozilla.javascript.optimizer.OptRuntime.call1(org/mozilla/javascript/optimizer/OptRuntime.java:32)
org.mozilla.javascript.gen._home_sivamanikandan__rvm_gems_jruby_1_7_13_empwiz_gems_less_2_5_1_lib_less_js_lib_less_parser_js_2._c_anonymous_24(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/less-2.5.1/lib/less/js/lib/less/parser.js:674)
org.mozilla.javascript.gen._home_sivamanikandan__rvm_gems_jruby_1_7_13_empwiz_gems_less_2_5_1_lib_less_js_lib_less_parser_js_2._c_anonymous_24(org/mozilla/javascript/gen//home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/less-2.5.1/lib/less/js/lib/less/parser.js:674)
org.mozilla.javascript.ContextFactory.doTopCall(org/mozilla/javascript/ContextFactory.java:394)
org.mozilla.javascript.ScriptRuntime.doTopCall(org/mozilla/javascript/ScriptRuntime.java:3091)
java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:606)
RUBY.parse(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/less-2.5.1/lib/less/parser.rb:64)
RUBY.do_open(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/therubyrhino-2.0.4/lib/rhino/context.rb:267)
RUBY.open(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/therubyrhino-2.0.4/lib/rhino/context.rb:252)
RUBY.exec(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/less-2.5.1/lib/less/java_script/rhino_context.rb:37)
RUBY.exec(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/less-2.5.1/lib/less/java_script.rb:26)
RUBY.parse(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/less-2.5.1/lib/less/parser.rb:63)
RUBY.evaluate(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/less-rails-2.5.0/lib/less/rails/template_handlers.rb:18)
RUBY.render(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/tilt-1.4.1/lib/tilt/template.rb:103)
RUBY.evaluate(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/context.rb:197)
RUBY.evaluate(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/context.rb:194)
org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)
RUBY.initialize(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/processed_asset.rb:12)
RUBY.build_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/base.rb:374)
RUBY.circular_call_protection(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/base.rb:395)
RUBY.build_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/base.rb:373)
RUBY.build_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/index.rb:94)
RUBY.cache_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/caching.rb:58)
RUBY.build_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/index.rb:93)
RUBY.find_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/base.rb:287)
RUBY.find_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/index.rb:61)
RUBY.resolve_dependencies(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/processed_asset.rb:111)
RUBY.resolve_dependencies(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/processed_asset.rb:105)
org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)
RUBY.build_required_assets(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/processed_asset.rb:97)
RUBY.initialize(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/processed_asset.rb:16)
RUBY.build_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/base.rb:374)
RUBY.circular_call_protection(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/base.rb:395)
RUBY.build_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/base.rb:373)
RUBY.build_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/index.rb:94)
RUBY.cache_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/caching.rb:58)
RUBY.build_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/index.rb:93)
RUBY.find_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/base.rb:287)
RUBY.find_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/index.rb:61)
RUBY.initialize(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/bundled_asset.rb:16)
RUBY.build_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/base.rb:377)
RUBY.build_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/index.rb:94)
RUBY.cache_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/caching.rb:58)
RUBY.build_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/index.rb:93)
RUBY.find_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/base.rb:287)
RUBY.find_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/index.rb:61)
RUBY.find_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:211)
RUBY.benchmark(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:257)
RUBY.find_asset(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:210)
RUBY.compile(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:119)
RUBY.compile(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:118)
org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)
RUBY.define(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-rails-2.1.3/lib/sprockets/rails/task.rb:61)
RUBY.with_logger(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-2.11.0/lib/rake/sprocketstask.rb:146)
RUBY.define(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/sprockets-rails-2.1.3/lib/sprockets/rails/task.rb:60)
RUBY.execute(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/rake-10.3.2/lib/rake/task.rb:240)
org.jruby.RubyProc.call(org/jruby/RubyProc.java:271)
RUBY.execute(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/rake-10.3.2/lib/rake/task.rb:235)
org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)
RUBY.invoke_with_call_chain(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/rake-10.3.2/lib/rake/task.rb:179)
RUBY.mon_synchronize(/home/sivamanikandan/.rvm/rubies/jruby-1.7.13/lib/ruby/1.9/monitor.rb:211)
RUBY.invoke_with_call_chain(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/rake-10.3.2/lib/rake/task.rb:172)
RUBY.invoke(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/rake-10.3.2/lib/rake/task.rb:165)
RUBY.before(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/bower-rails-0.8.3/lib/tasks/helpers/before_hook.rb:16)
RUBY.execute(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/rake-10.3.2/lib/rake/task.rb:240)
org.jruby.RubyProc.call(org/jruby/RubyProc.java:271)
RUBY.execute(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/rake-10.3.2/lib/rake/task.rb:235)
org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)
RUBY.invoke_with_call_chain(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/rake-10.3.2/lib/rake/task.rb:179)
RUBY.mon_synchronize(/home/sivamanikandan/.rvm/rubies/jruby-1.7.13/lib/ruby/1.9/monitor.rb:211)
RUBY.invoke_with_call_chain(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/rake-10.3.2/lib/rake/task.rb:172)
RUBY.invoke(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/rake-10.3.2/lib/rake/task.rb:165)
RUBY.invoke_task(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/rake-10.3.2/lib/rake/application.rb:150)
RUBY.top_level(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/rake-10.3.2/lib/rake/application.rb:106)
RUBY.top_level(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/rake-10.3.2/lib/rake/application.rb:106)
org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)
RUBY.run_with_threads(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/rake-10.3.2/lib/rake/application.rb:115)
RUBY.top_level(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/rake-10.3.2/lib/rake/application.rb:100)
RUBY.run(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/rake-10.3.2/lib/rake/application.rb:78)
RUBY.standard_exception_handling(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/rake-10.3.2/lib/rake/application.rb:176)
RUBY.run(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/gems/rake-10.3.2/lib/rake/application.rb:75)
org.jruby.RubyKernel.load(org/jruby/RubyKernel.java:1081)
org.jruby.RubyKernel.eval(org/jruby/RubyKernel.java:1101)
RUBY.(root)(/home/sivamanikandan/.rvm/gems/jruby-1.7.13#empwiz/bin/jruby_executable_hooks:15)
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
this seems like a bug in JRuby's java integration ... please try updating to JRuby 1.7.16
Related
So I am seeing this below, the file exist and this is the ruby line of code thats supposed to run:
upload = #browser.file_field(:type => 'file', :class => 'react-fine-uploader-file-input')
upload.send_keys("workplace/uploads/test1.mp3")
#browser.button(:class => 'change-file-button').wait_until_present
Jenkins error below in the console output:
File not found: workplace/uploads/test1.mp3
(Selenium::WebDriver::Error::InvalidArgumentError)
I opened a Clojure project in Intelij IDEA and everything had been working well until I have made new Clojure workspace and have written some Clojure code in it. When I try to execute this piece of code in REPL I get always the same error. Whatever I write, I get the same error. For example when I try to execute (+ 1 1_ I get the following error:
Syntax error compiling at (test.clj:4:1).
Unable to resolve symbol: + in this context
Has someone already faced this issue?
Here is my project.clj
(defproject test-app "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:dependencies [[cheshire "5.8.1"]
[clojure.java-time "0.3.2"]
[cprop "0.1.13"]
[funcool/struct "1.3.0"]
[luminus-immutant "0.2.5"]
[luminus-transit "0.1.1"]
[luminus/ring-ttl-session "0.3.2"]
[markdown-clj "1.0.7"]
[metosin/muuntaja "0.6.4"]
[metosin/reitit "0.3.1"]
[metosin/ring-http-response "0.9.1"]
[mount "0.1.16"]
[nrepl "0.6.0"]
[org.clojure/clojure "1.10.0"]
[org.clojure/tools.cli "0.4.2"]
[org.clojure/tools.logging "0.4.1"]
[org.webjars.npm/bulma "0.7.4"]
[org.webjars.npm/material-icons "0.3.0"]
[org.webjars/webjars-locator "0.36"]
[org.webjars/webjars-locator-jboss-vfs "0.1.0"]
[ring-webjars "0.2.0"]
[ring/ring-core "1.7.1"]
[ring/ring-defaults "0.3.2"]
[selmer "1.12.12"]]
:min-lein-version "2.0.0"
:source-paths ["src/clj"]
:test-paths ["test/clj"]
:resource-paths ["resources"]
:target-path "target/%s/"
:main ^:skip-aot test-app.core
:plugins [[lein-immutant "2.1.0"]]
:profiles
{:uberjar {:omit-source true
:aot :all
:uberjar-name "test-app.jar"
:source-paths ["env/prod/clj"]
:resource-paths ["env/prod/resources"]}
:dev [:project/dev :profiles/dev]
:test [:project/dev :project/test :profiles/test]
:project/dev {:jvm-opts ["-Dconf=dev-config.edn"]
:dependencies [[expound "0.7.2"]
[pjstadig/humane-test-output "0.9.0"]
[prone "1.6.1"]
[ring/ring-devel "1.7.1"]
[ring/ring-mock "0.3.2"]]
:plugins [[com.jakemccrary/lein-test-refresh "0.24.1"]]
:source-paths ["env/dev/clj"]
:resource-paths ["env/dev/resources"]
:repl-options {:init-ns user}
:injections [(require 'pjstadig.humane-test-output)
(pjstadig.humane-test-output/activate!)]}
:project/test {:jvm-opts ["-Dconf=test-config.edn"]
:resource-paths ["env/test/resources"]}
:profiles/dev {}
:profiles/test {}})
Everything works fine when I write code in my namespace test-app.routes.home, but when I make new Clojure namespace test.clj in the same routes folder, I cant evaluate code in REPL. When I press ctrl+Enter I get this error:
Syntax error compiling at (test.clj:4:1).
Unable to resolve symbol: + in this context
(Maybe) You need to evaluate your namespace (ns ....) before trying to evaluate any other expression.
I'm trying to install the Ant Design library via :npm-deps, so in my project.clj I have:
:cljsbuild {:builds {:app
{:source-paths ["src" "env/dev/cljs"]
:compiler
{:main "metro-parks-cljs-components.dev"
:output-to "public/js/app.js"
:output-dir "public/js/out"
:asset-path "js/out"
:source-map true
:optimizations :none
:install-deps true
:npm-deps {:react "^16.8.5"
:react-dom "^16.8.5"
:antd "^3.15.2"
:moment "^2.24.0"}}
...
And in my app code:
(ns metro-parks-cljs-components.event-finder
(:require
...
[reagent.core :as r]
[moment]
[antd :refer [DatePicker Pagination]]))
This compiles but on page load I get:
Error: Undefined nameToPath for module$home$ctamayo$workspace$metro_parks$wp_content$themes$metro_parks$metro_parks_cljs_components$node_modules$antd$es$affix base.js:1357:21
visitNode http://localhost:3449/js/out/goog/base.js:1357
visitNode http://localhost:3449/js/out/goog/base.js:1355
visitNode http://localhost:3449/js/out/goog/base.js:1355
visitNode http://localhost:3449/js/out/goog/base.js:1355
writeScripts_ http://localhost:3449/js/out/goog/base.js:1369
require http://localhost:3449/js/out/goog/base.js:706
<anonymous> http://localhost:3449/index.html:80
Is this a known issue with npm-deps right now? Is there a workaround?
Note: I have looked into using shadow-cljs but I'm hesitant to migrate to a whole new build system due to time constraints.
I have a Rails 3.2.8 app using Ruby 1.9.3. I am trying to configure slack integration to work with execption_notification. execption_notification works fine for mail, but after adding slack integration based on the readme HERE I get this error when trying to start the server...
exception_notifier.rb:102:in `rescue in create_and_register_notifier': No notifier named 'slack' was found. Please, revise your configuration options. Cause: uninitialized constant ExceptionNotifier::SlackNotifier (ExceptionNotifier::UndefinedNotifierError)
Here are the relevant lines in my config/env/production.rb
#email notifications for exception in app
MyApp::Application.config.middleware.use ExceptionNotification::Rack,
:email => {
:email_prefix => "[Exception] ",
:sender_address => %{"notifier" <notifier#example.com>},
:exception_recipients => %w{email},
},
:slack => {
:webhook_url => "[mySlackHook",
:channel => "#exceptions",
:additional_parameters => {
:icon_url => "error.png"
}
}
Slack integration hasn't been added in the current version of the exception_notification gem on RubyGems (https://rubygems.org/gems/exception_notification)
Try using the git repo version:
In your Gemfile:
gem 'exception_notifications', git: 'https://github.com/smartinez87/exception_notification.git'
or specifying the '4.1.0rc1' version in your Gemfile
In my rails 3.2.3 app, I have a topics controller, which is modeled as a resource. I want to write a functional test to verify that post on /topics is a valid route. This should fail first, and then I will add the code to fix it. However, I am getting an error in the routing test, instead of a failure. What am I doing wrong?(Note: If I fix the route in routes.rb, the test passes - just not sure why I am getting an error instead of a failure in the test):
# topics_controller_test.rb
test 'route exists to create topic' do
assert_routing({:path => '/topics', :method => 'post'} , { :controller => "topics", :action => "create"}, {}, {}, 'could not route to create topic')
end
# routes.rb
resources :topics, :only => [:new]
# terminal output
$ rake test:functionals
Run options:
# Running tests:
.....E.
Finished tests in 0.373543s, 18.7395 tests/s, 53.5414 assertions/s.
1) Error:
test_route_exists_to_create_topic(TopicsControllerTest):
ActionController::RoutingError: No route matches "/topics"
.../gems/ruby-1.9.3-p0/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:633:in `recognize_path'
.../gems/ruby-1.9.3-p0/gems/actionpack-3.2.3/lib/action_dispatch/testing/assertions/routing.rb:210:in `recognized_request_for'
.../gems/ruby-1.9.3-p0/gems/actionpack-3.2.3/lib/action_dispatch/testing/assertions/routing.rb:42:in `assert_recognizes'
.../gems/ruby-1.9.3-p0/gems/actionpack-3.2.3/lib/action_dispatch/testing/assertions/routing.rb:118:in `assert_routing'
`.../myapp/test/functional/topics_controller_test.rb:25:in block in <class:TopicsControllerTest>'`
>> 7 tests, 20 assertions, 0 failures, 1 errors, 0 skips
The created route in routes.rb is different from the route your testing. If you want to route to the :create action in the controller, in your routes.rb you should use:
resources :topics, :only => [:create]
See the routing topic in the RailsGuides.