Search Results

Search found 3862 results on 155 pages for 'blank'.

Page 11/155 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Only show non blank attributes for a model in views in Rails

    - by Senthil
    Say I've a user model and there are bunch of user info, like email, birthdate, location, telephone number etc. What's the simplest way of hiding the attributes that are blank? I've doing something like <% if blog.title.empty? -%> <p>Body: <%=h blog.body %></p> <p>Comments: <%=h blog.comments %></p> <% elsif blog.body.empty? %> <p>Title: <%=h blog.title %></p> <p>Comments: <%=h blog.comments %></p> <% else -%> <p>Title: <%=h blog.title %></p> <p>Body: <%=h blog.body %></p> <% end -%> Clearly that is one ugly child. Other than using partials to render, is there a trick to only show non blank fields? I've been trying to write a helpher method to make the view cleaner, but that's even more ugly. Any help is appreciated.

    Read the article

  • S.redirectTo leads always to a blank screen

    - by Jaime Ocampo
    I am now playing a little bit with lift (2.8.0), and all the features in LiftRules work as intended. But I haven't been able to use S.redirectTo at all. I always ends with a blank screen, no matter what. No error messages at all! As an example, I have the following form: ... <lift:logIn.logInForm form="post"> <p><login:name /></p> <p><login:password /></p> <p><login:submit /></p> </lift:logIn.logInForm> ... And the code is: object LogIn extends helper.LogHelper { ... def logInForm(in: NodeSeq): NodeSeq = { var name = "" var password = "" def login() = { logger.info("name: " + name) logger.info("password: " + password) if (name == "test1") S.redirectTo("/example") if (name == "test2") S.redirectTo("/example.html") if (name == "test3") S.redirectTo("example.html") S.redirectTo("/") } bind("login", in, "name" -> SHtml.text(name, name = _), "password" -> SHtml.password(password, password = _), "submit" -> SHtml.submit("Login", login)) } } The method 'login' is invoked, I can check that in the log information. But as I said, no matter which name I enter, I always end with a blank screen, although 'examples.html' is available when being accessed directly in the browser. How should I invoke S.redirectoTo in order to navigate to 'examples.html'? Also, why don't I receive an error message (I am logging at a debug level)? I think all the configuration in Boot is correct, since all LitRules examples (statelessRewrite, dispatch, viewDispatch, snippets) work fine.

    Read the article

  • codingstyle "blanking after open and before close brackets"

    - by Oops
    Hi, I really like the "blanking after open and before close brackets"-codingstyle in modern codes Java/C#/C++ . e.g. calling a function: foo(myparam); // versus foo( myparam ); Do you have a better name for this codingstyle? where does it come from? Do you like it either, what is the reason for you to use it or not use it? a few years ago people said "you are blanking" if one has used too much blank space characters in a forumspost or email. many thanks in advance regards Oops

    Read the article

  • codingstyle "blanking after open and before close brackets"

    - by Oops
    I really like the "blanking after open and before close brackets"-codingstyle in modern codes Java/C#/C++ . e.g. calling a function: foo(myparam); // versus foo( myparam ); Do you have a better name for this codingstyle? where does it come from? Do you like it either, what is the reason for you to use it or not use it? a few years ago people said "you are blanking" if one has used too much blank space characters in a forumspost or email. many thanks in advance regards Oops edit: two cons, any pros out there?

    Read the article

  • Edit form not being instanciated

    - by 47
    I have two models like this: class OptionsAndFeatures(models.Model): options = models.TextField(blank=True, null=True) entertainment = models.TextField(blank=True, null=True) seats_trim = models.TextField(blank=True, null=True) convenience = models.TextField(blank=True, null=True) body_exterior = models.TextField(blank=True, null=True) lighting = models.TextField(blank=True, null=True) safety = models.TextField(blank=True, null=True) powertrain = models.TextField(blank=True, null=True) suspension_handling = models.TextField(blank=True, null=True) specs_dimensions = models.TextField(blank=True, null=True) offroad_capability = models.TextField(blank=True, null=True) class Vehicle(models.Model): ... options_and_features = models.ForeignKey(OptionsAndFeatures, blank=True, null=True) I have a model form for the OptionsAndFeaturesclass that I'm using in both the add and edit views. In the add view it works just fine. But the edit view renders the OptionsAndFeatures as blank. The code for the edit view is as follows: def edit_vehicle(request, stock_number=None): vehicle = get_object_or_404(Vehicle, stock_number=stock_number) if request.method == 'POST': # save info else: vehicle_form = VehicleForm(instance=vehicle) photos = PhotosFormSet(instance=vehicle) options = OptionsForm(instance=vehicle) #render_to_reponse What could be the problem here?

    Read the article

  • localhost yes but phpmyadmin blank

    - by Giskin Leow
    WAMP people having problem with both localhost and phpmyadmin loads blank which usually the port problem. Mine is only phpmyadmin blank. sqlbuddy and phpinfo no problem. tried uninstall reinstalled wamp. tried xampp, same problem, all works well, not phpmyadmin. mysql log: 120905 8:03:08 [Note] Plugin 'FEDERATED' is disabled. 120905 8:03:08 InnoDB: The InnoDB memory heap is disabled 120905 8:03:08 InnoDB: Mutexes and rw_locks use Windows interlocked functions 120905 8:03:08 InnoDB: Compressed tables use zlib 1.2.3 120905 8:03:09 InnoDB: Initializing buffer pool, size = 128.0M 120905 8:03:09 InnoDB: Completed initialization of buffer pool 120905 8:03:09 InnoDB: highest supported file format is Barracuda. 120905 8:03:09 InnoDB: Waiting for the background threads to start 120905 8:03:10 InnoDB: 1.1.8 started; log sequence number 1595675 120905 8:03:11 [Note] Server hostname (bind-address): '(null)'; port: 3306 120905 8:03:11 [Note] - '(null)' resolves to '::'; 120905 8:03:11 [Note] - '(null)' resolves to '0.0.0.0'; 120905 8:03:11 [Note] Server socket created on IP: '0.0.0.0'. 120905 8:03:13 [Note] Event Scheduler: Loaded 0 events 120905 8:03:13 [Note] wampmysqld: ready for connections. apache log [Wed Sep 05 08:03:09 2012] [notice] Apache/2.2.22 (Win32) PHP/5.4.3 configured -- resuming normal operations [Wed Sep 05 08:03:09 2012] [notice] Server built: May 13 2012 13:32:42 [Wed Sep 05 08:03:09 2012] [notice] Parent: Created child process 3812 [Wed Sep 05 08:03:09 2012] [notice] Child 3812: Child process is running [Wed Sep 05 08:03:09 2012] [notice] Child 3812: Acquired the start mutex. [Wed Sep 05 08:03:09 2012] [notice] Child 3812: Starting 64 worker threads. [Wed Sep 05 08:03:09 2012] [notice] Child 3812: Starting thread to listen on port 80. [Wed Sep 05 08:03:09 2012] [notice] Child 3812: Starting thread to listen on port 80. [Wed Sep 05 08:04:14 2012] [error] [client 127.0.0.1] File does not exist: C:/wamp/www/favicon.ico [Wed Sep 05 08:09:50 2012] [error] [client 127.0.0.1] File does not exist: C:/wamp/www/favicon.ico [Wed Sep 05 08:41:03 2012] [error] [client 127.0.0.1] File does not exist: C:/wamp/www/phpMyAdmin

    Read the article

  • PHP session_write_close() causes empty response

    - by Xeoncross
    When using session_write_close() in a shutdown function at the end of my script - PHP just dies. There is no error logged, response headers (firebug), or data (even whitespace!) returned. I have full PHP error reporting on with STRICT enabled and PHP 5.2.1. My guess is that since session_write_close() is being called after shutdown - some fatal error is being encountered that crashes PHP before it has a chance to send the output or log anything. This only happens on the logout page where I first: ... //If there is no session to delete (not started) if ( ! session_id()) { return; } // Get the session name $name = session_name(); // Delete the session cookie (if exists) if ( ! empty($_COOKIE[$name])) { //Get the current cookie config $params = session_get_cookie_params(); // Delete the cookie from globals unset($_COOKIE[$name], $_SESSION); //Delete the cookie on the user_agent setcookie($name, '', time()-43200, $params['path'], $params['domain'], $params['secure']); } // Destroy the session session_destroy(); ... then 2) do some more stuff 3) issue a redirect and 4) finally, after the whole page is done the register_shutdown_function(); I placed earlier runs and calls session_write_close() which saves the session to the database. The end. Since this blank response only occurs on logout I'm guessing that I'm not restarting the session properly which is causing session_write_close() to die fatally at the end of the script.

    Read the article

  • Creating a cocoa Application without nib files/fully pragmatic

    - by Moddy
    Yes, I know this goes against the whole MVC principle! However, I'm just trying to whip up a pretty trivial application - and I've pretty much implemented it pragmatically. However, I have a problem... I create an Empty Project, copy all the frameworks over and set the build settings - and I get errors about the executable.. or lack of executable. The build settings all appear fine, but it tells me there is no executable - it will build + run fine.. however it doesn't run. There is no error either - it just appears to run very fast and cleanly! Unless I try and run gdb which politely tells me I need to give it a file first.. Running… No executable file specified. Use the "file" or "exec-file" command. So I created a Cocoa Application, removed all the stuff I didn't need (i.e the MainMenu.xib file..) and now I can compile my code perfectly.. however it dies with complaining that its "Unable to load nib file: MainMenu, exiting" I have gone through the Project Symbols and see that the code actually relies upon the nib file heavily, even if you don't touch it code-wise. (MVC again I guess..) So my question is - is there a simple way to compile just what you code, no added nib files, just the code you write and the frameworks you add? I assume it would be a blank project but my experience tells me otherwise?!

    Read the article

  • Silverlight blank browser

    - by Andrew Kalashnikov
    Hello, colleagues. I've got a problem with SilverLight default VS2008 project. Wnen i create new SL project and choose ASP.NET Web Site web project type all is ok, at my browser I see default template. But when I choose ASP.NET Web application, at running I get blank browser screen with js error: "Unhandled Error in Silverlight Application Code: 2104 Category: InitializeError Message: Could not download the Silverlight application. Check web server settings" What's wrong? Thanks for answer

    Read the article

  • IIS 7, loads blank screen

    - by JL
    I've just setup an application under the default web site installed by IIS 7. I've tried loading both http://localhost and http://localhost/myappname in both cases, all I am getting is a blank page, no errors. And although directory browsing is enabled, I can't even see a list of the files in that directory. Any ideas why this is? Thanks in advance...

    Read the article

  • MySQL REGEXP: matching blank entries

    - by Erwin Paglinawan
    Hi, I have this SQL condition that is supposed to retrieve all rows that satisfy the given regexp condition: country REGEXP ('^(USA|Italy|France)$') However, I need to add a pattern for retrieving all blank country values. Currently I am using this condition country REGEXP ('^(USA|Italy|France)$') OR country = "" How can achieve the same effect without having to include the OR clause? Thanks, Erwin

    Read the article

  • Running DOS command through C# just opens blank cmd window

    - by Mohit Deshpande
    I was trying to execute a command through C#, but when I run the following code, a blank cmd window just opens up. The code: string command = string.Format(@"adb install C:\Users\Mohit\Programming\Android_Workspace\{0}\bin\{0}.apk", appName); ProcessStartInfo cmdsi = new ProcessStartInfo("cmd.exe"); cmdsi.Arguments = command; Process cmd = Process.Start(cmdsi); What could be wrong? I am sure the syntax is right.

    Read the article

  • Blank page shown in Mozilla Firefox

    - by Arun
    I have a jsf page which works perfectly fine[Both in IE and Mozilla Firefox] when the application is deployed locally. But i deploy it at the client place and I try to access the page in mozilla FF i get a blank page but it shows up properly in IE. Now if i do a remote desktop connection to the system where the application is deployed and try to access the same page i get to see the page correctly in both mozilla ff & IE Is this due to some sort of network issue specific to mozilla?

    Read the article

  • Geshi on WebSVN makes my code files appear blank

    - by Travis Johnson
    In config.php, if i uncomment the following line $config->useGehsi(); Suddenly, when I load up a C# file, instead of showing the document, it's just a blank page. As soon as I comment out the code above, I'm able to see my C# file, but there's no syntax highlighting. Anyone have a solution to get GeSHi working with WebSVN when this kind of error occurs?

    Read the article

  • zend_application showing blank page

    - by daniel
    Hi, I'm using Zend_Application to bootstrap my app. class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { public static $frontController = null; public static $registry = null; protected function _initEnvironment() { ini_set('display_errors', true); //date_default_timezone_set('Europe/London'); } protected function _initRegistry() { self::$registry = new Zend_Registry(array(), ArrayObject::ARRAY_AS_PROPS); Zend_Registry::setInstance(self::$registry); } protected function _initConfiguration() { $config = new Zend_Config_Ini( BASE_PATH . '/data/server/settings.ini', APPLICATION_ENV ); self::$registry->configuration = $config; } protected function _initLogging() { $config = self::$registry->configuration; $logger = new Zend_Log(new Zend_Log_Writer_Stream($config->logging->file)); Zend_Registry::set('logger', $logger); } protected function _initFrontController() { self::$frontController = Zend_Controller_Front::getInstance(); self::$frontController->throwExceptions(true); self::$frontController->returnResponse(true); self::$frontController->setControllerDirectory( APPLICATION_PATH .'/controllers' ); self::$frontController->setParam('registry', self::$registry); return self::$frontController; } protected function _initView() { $config = self::$registry->configuration; $view = new Zend_View; $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view); Zend_Controller_Action_HelperBroker::addHelper($viewRenderer); Zend_Layout::startMvc( array( 'layoutPath' => APPLICATION_PATH . "/layouts/scripts", 'layout' => "layout" ) ); return $view; } protected function _initDatabase() { $config = self::$registry->configuration; $params = array('host' => $config->database->hostname, 'username' => $config->database->username, 'password' => $config->database->password, 'dbname' => $config->database->database); $db = Zend_Db::factory($config->database->type, $params); Zend_Registry::set('db', $db); } protected function _initPlaceholders() { $view = $this->getResource('View'); $view->doctype('XHTML1_STRICT'); $view->headTitle('Greplin') ->setSeparator(' / '); $view->headLink()->prependStylesheet('/src/css/header.css'); $view->headScript()->prependFile('/js/site.js'); return $view; } } When I run the app I get a blank page. Filenames / paths are intact. If I add die() to the bottom of my layout.phtml, I get the page. Something is resetting the headers and sending a blank page. My error reporting is on and I get unrelated errors. What could this be?! Thanks!

    Read the article

  • Need help with regex blank space

    - by Gandalf StormCrow
    How to replace from regex many empty/blank characters with none? ex: <div class="someClass" id="someID"> ...bunch of elements/content <input type="button" name="myInput" id="inputID" title="myInput Title" /> ...bunch of elements/content </div> when replaced : <a class="myselector" rel="I need this value"></a><div class="someClass" id="someID">...bunch of elements/content<input type="button" name="myInput" id="inputID" title="myInput Title" />...bunch of elements/content</div>

    Read the article

  • Rails, destroy if blank

    - by Joseph Silvashy
    This might sound odd, but is there a 'Rails way' to have a model destroyed if a certain attribute is blank? Say I have a model like tags with just a name attribute or something, if the user edits the tag and deletes all the text out of the name field in the form I'd like the model to just be deleted. I'm aware of the reject_if method, but that doesn't seem to work.

    Read the article

  • table outputs blank rows on the browser

    - by fusion
    following the answer here, altho it solved my problem, it displays a blank table. .something like this. the data does get inserted in the mysql but the table displays nothing. the codes are posted on the above link. your help would be appreciated. thanks!

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >