Search Results

Search found 8 results on 1 pages for 'activeadmin'.

Page 1/1 | 1 

  • Cannot login to Activeadmin after gem update

    - by user1883793
    After bundle update I cannot login to my Activeadmin, here is the log. Is it because the unpermitted params? do I need to config strong parameter to make admin login work? I already have this code for devise: def configure_permitted_parameters devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:email, :password, :remember_me) } devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:username, :email, :password) } end Started POST "/admin/login" for 127.0.0.1 at 2013-10-30 22:33:25 +1300 Processing by ActiveAdmin::Devise::SessionsController#create as HTML Parameters: {"utf8"=>"?", "authenticity_token"=>"MhoM/R/oVfad/iiov2zpqfoJ5XOSLda6rTl/V2cMIZE=", "admin_user"=>{"email"=>"[email protected]", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Login"} Completed 401 Unauthorized in 0.6ms Processing by ActiveAdmin::Devise::SessionsController#new as HTML Parameters: {"utf8"=>"?", "authenticity_token"=>"MhoM/R/oVfad/iiov2zpqfoJ5XOSLda6rTl/V2cMIZE=", "admin_user"=>{"email"=>"[email protected]", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Login"} Unpermitted parameters: email, password, remember_me Rendered /home/jcui/.rvm/gems/ruby-1.9.3-p194/gems/activeadmin-0.6.2/app/views/active_admin/devise/shared/_links.erb (0.6ms) Rendered /home/jcui/.rvm/gems/ruby-1.9.3-p194/gems/activeadmin-0.6.2/app/views/active_admin/devise/sessions/new.html.erb within layouts/active_admin_logged_out (118.2ms) Completed 200 OK in 130.7ms (Views: 129.9ms | ActiveRecord: 0.0ms | Solr: 0.0ms)

    Read the article

  • form doesn't work after use render

    - by Rodrigo
    I trying to use render method inside my activeAdmin form method, but after insert render in code, it stopped to work. form do |f| f.inputs I18n.t('sale_header') do f.input :client f.input :room end f.inputs I18n.t('sale_items') do render :partial => "form_sale" end f.inputs I18n.t('totalization') do f.input :sub_total, :input_html => { :disabled => :true } f.input :discount f.input :total_value, :input_html => { :disabled => :true } end f.buttons end After insert the render method, only form_sale content is showed on screen. Any help? Thank You!

    Read the article

  • active_admin/formtastic ignoring polymorphic associations

    - by James Maskell
    I'm currently having trouble with the form for a polymorphic association in active_admin in Ruby on Rails. I have three models set up: offices, companies and users. Both companies and users can own an office. My models are set up as follows: class Office < ActiveRecord::Base belongs_to :ownable, :polymorphic => true end class User < ActiveRecord::Base has_many :offices, :as => :ownable end class Company < ActiveRecord::Base has_many :offices, :as => :ownable end active_admin doesn't allow me to edit the owner on its forms, but does show it correctly on the index and show pages (including links to the company or user). I've tried playing with formtastic to manually create the form but have not had any luck - the "ownable" fields just get ignored and everything else renders properly. To be clear: I want to be able to edit the owner of the Office model on the new and edit fields in active_admin. Can anyone offer any help? :)

    Read the article

  • Find and sort by number of ocurrences of tag with Active Admin and act_as_taggable_on

    - by nunopolonia
    I'm using act_as_taggable_on and Active Admin on a Rails project. In that project there are Posts and each Post has Tags. I want to show a list of Tags in Active Admin and the number of ocurrences of each one. The way I found to do this was: index do column :name column :ocurrences do |tag| ocurrences = Post.tag_counts.find(tag.id).count end default_actions end Which will search the Tag List every time for every Post, which performance wise looks really bad. I would also like to be able to sort the tags by ocurrence. Any idea of how I can do it?

    Read the article

  • Ruby on Rails - Belongs_to and Active Admin not creating foreign ID

    - by Milo
    I have the following setup: class Category < ActiveRecord::Base has_many :products end class Product < ActiveRecord::Base belongs_to :category has_attached_file :photo, :styles => { :medium => "300x300>", :thumb => "200x200>" } validates_attachment_content_type :photo, :content_type => /\Aimage\/.*\Z/ end ActiveAdmin.register Product do permit_params :title, :price, :slideshow, :photo, :category form do |f| f.inputs "Product Details" do f.input :title f.input :category f.input :price f.input :slideshow f.input :photo, :required => false, :as => :file end f.actions end show do |ad| attributes_table do row :title row :category row :photo do image_tag(ad.photo.url(:medium)) end end end index do column :id column :title column :category column :price do |product| number_to_currency product.price end actions end class ProductController < ApplicationController def create @product = Product.create(params[:id]) end end Every time I make a product item in activeadmin the category comes up empty. It wont populate the column category_id for the product. It just leaves it empty. What am I doing wrong?

    Read the article

  • rails link path and routing error

    - by Nick5a1
    <%= link_to t('.new', :default => t("helpers.links.new")), new_equipment_path, :class => 'btn btn-primary' %> I have the above code in a view, but am getting the following error when clicking the link: No route matches {:action=>"show", :controller=>"equipment"} My routes file contains: devise_for :users ActiveAdmin.routes(self) devise_for :admin_users, ActiveAdmin::Devise.config resources :equipment resources :workouts root :to => "home#index" match 'workouts/random', :to => 'workouts#random' match ':controller(/:action(/:id))(.:format)' Why is it trying to access the show action?

    Read the article

  • Devise not allowing active resource to access the services

    - by Saurabh Pandit
    In my application there are two folders one for a rails application and another for a ruby application. In the ruby folder I have created a ruby file in which I have written code to access some model which is present in the rails application using active resource. Sample code is shown below : active_resource_example.rb require 'rubygems' require 'active_resource' class Website < ActiveResource::Base self.site = "http://localhost:3000/admin/" self.user = "user" self.password = "password" end websites = Website.find(:all) puts websites.inspect In my rails application I have used ActiveAdmin gem which uses devise for authentication. On rails Server I get the following result : Started GET "/admin/websites.json" for 192.168.1.37 at 2011-11-12 14:41:06 +0530 Processing by Admin::WebsitesController#index as JSON Completed in 43ms And on my terminal where I executed active_resource_example.rb, I got following error : user@user:~/Desktop$ ruby active_resource_example.rb /home/user/.rvm/gems/ruby-1.9.2-p180/gems/activeresource-3.1.1/lib/active_resource/connection.rb:132:in `handle_response': Failed. Response code = 401. Response message = Unauthorized . (ActiveResource::UnauthorizedAccess) from /home/user/.rvm/gems/ruby-1.9.2-p180/gems/activeresource-3.1.1/lib/active_resource/connection.rb:115:in `request' from /home/user/.rvm/gems/ruby-1.9.2-p180/gems/activeresource-3.1.1/lib/active_resource/connection.rb:80:in `block in get' from /home/user/.rvm/gems/ruby-1.9.2-p180/gems/activeresource-3.1.1/lib/active_resource/connection.rb:218:in `with_auth' from /home/user/.rvm/gems/ruby-1.9.2-p180/gems/activeresource-3.1.1/lib/active_resource/connection.rb:80:in `get' from /home/user/.rvm/gems/ruby-1.9.2-p180/gems/activeresource-3.1.1/lib/active_resource/base.rb:894:in `find_every' from /home/user/.rvm/gems/ruby-1.9.2-p180/gems/activeresource-3.1.1/lib/active_resource/base.rb:806:in `find' from active_resource_example.rb:12:in `<main>' user@user:~/Desktop$ I tried this with another application in which Devise authentication is not used with the same configuration I used in active_resource_example.rb, there I got the result. Desperately need some solution to this issue.

    Read the article

  • Spork doesnt reload code

    - by there-is-no-spoon
    I am using following gems and ruby-1.9.3-p194: rails 3.2.3 rspec-rails 2.9.0 spork 1.0.0rc2 guard-spork 0.6.1 Full list of used gems is available in this Gemfile.lock or Gemfile. And I am using this configuration files: Guardfile .rspec spec_helper.rb factories.rb If I modify any model (or custom validator in app/validators etc) reloading code doesnt works. I mean when I run specs (hit Enter on guard console) Spork contain "old code" and I got obsolete error messages. But when I manually restart Guard and Spork (CTRC-C CTRL-d guard) everything works fine. But it is getting tired after few times. Questions: Can somebody look at my config files please and fix error which block updating code. Or maybe this is an issue of newest Rails version? PS This problem repeats and repeats over some projects (and on some NOT). But I haven't figured out yet why this is happens. PS2 Perhaps this problem is something to do with ActiveAdmin? When I change file in app/admin code is reloaded.

    Read the article

1