This tutorial will guide you to create a simple app with a Login screen which takes username and password from the user and then posts it to a url and parses the JSON response form the server.
Process and array or a hash inside a perl template #Print an Array named items [% FOREACH item IN items -%] [% item %] [% END -%] #Print a HASH named items [% FOREACH key IN items.keys.sort -%] [% key %]: [% terms.$key %] [% END -%] Enjoy coding!
Lets create a controller named ‘home‘ with views ‘index‘, ‘view2′ view3′. Fortunately, you can do that in a single command. Enter this command in your terminal: $ rails generate controller home index view2 view3 Rails will create several files for you, including app/views/home/index.html.erb. This is the template that will be used to display the results [...]
If you are writing a custom module, and you want it to be accessed only by admins, then you possibly need the following code in your controller. //get the admin session Mage::getSingleton(’core/session’, array(’name’=>’adminhtml’)); //verify if the user is logged in to the backend if(Mage::getSingleton(’admin/session’)->isLoggedIn()){ echo "Admin Logged in"; } else { echo "You need to [...]





