1. Simple Logic
  2. Blog
  3. Technical

Technical

7Feb 2017

How to Debug Your Android App over WiFi (without Cable)

Discovered this little trick it is immensely helpful. So far, whenever while working on any Android apps, to connect it to a Computer with a USB cable. The USB cable is annoying with limited movements. As I have searched, if there is an option to do the debugging over WiFi.
Luckily, there is a super simple way!

For Initial Setup there is need to be connect USB Cable, Make sure USB debugging is working.

how to debug

Now you can debug Android app Over WiFi(wireless)

Happy wireless coding!

3Feb 2017

RoR – Active Admin Filters on Attributes of Associated Models

In one of our application there was a requirement to have filters on attributes of associated models. We use ActiveAdmin andit provides a nice feature to satisfy this requirement with the help of Ransack(https://github.com/activerecord-hackery/ransack) gem.

Let’s consider following example:
class Order < ActiveRecord::Base
belongs_to :customer
has_many :order_products
end

class OrderProduct < ActiveRecord::Base
belongs_to :order
end

Now, we need to have a filter for ‘order_date’ field of Order table on OrderProduct index page. And We can simply achieve this with following:
ActiveAdmin.register OrderProduct do
filter :order_order_date, as: :date_range
end

Also we can have filters for attrbiutes of associations of association as follows.

For eg:
If we need to have filter for ‘account_code’ field of Customer table which is associated with Order table then we can do folllowing:
filter :order_customer_account_code, as: :string

Simple Logic IT Private Ltd.
609,Damji Shamji Corporate Square, Melville Estate, Next to KBC, Ghatkopar Andheri Link Road, Ghatkopar (E), Mumbai - 400 075.
Mo: +91 8291708207
Email: enquiry@simplelogic.in